我遇到了picamera和python的问题。我想要做的就是获取一个变量名称,然后保存一个与.jpg文件类型连接的变量名称的图片。
import picamera
import time
camera = picamera.PiCamera()
camera.vflip = True
camera.hflip = True
itemname = raw_input ('what is the item name? ')
time.sleep(6)
camera.capture(itemname,'.jpg')
time.sleep(2)
camera.close()
print "done"
答案 0 :(得分:0)
这是正确的语法
import picamera
import time
camera = picamera.PiCamera()
camera.vflip = True
camera.hflip = True
itemname = raw_input ('what is the item name? ')
time.sleep(6)
camera.capture(itemname + ".jpg")
time.sleep(2)
camera.close()
print "done"