Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/361.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 必须以实例作为第一个参数来调用unbound方法(改为获取str实例)_Python_Python 2.7_Camera_Raspberry Pi3 - Fatal编程技术网

Python 必须以实例作为第一个参数来调用unbound方法(改为获取str实例)

Python 必须以实例作为第一个参数来调用unbound方法(改为获取str实例),python,python-2.7,camera,raspberry-pi3,Python,Python 2.7,Camera,Raspberry Pi3,这是第一个草图,然后该功能将由运动传感器的输出进行管理,但现在我将while in循环用于尝试开始录制和预览,但我在标题中解释了错误。为什么? 对不起,我是python和raspberry开发方面的新手。camera=PiCamera()我认为.omg这是一个多么愚蠢的错误!现在可以了,谢谢。 from picamera import PiCamera from time import sleep camera = PiCamera camera.hflip = True #camera ad

这是第一个草图,然后该功能将由运动传感器的输出进行管理,但现在我将while in循环用于尝试开始录制和预览,但我在标题中解释了错误。为什么?


对不起,我是python和raspberry开发方面的新手。

camera=PiCamera()
我认为.omg这是一个多么愚蠢的错误!现在可以了,谢谢。
from picamera import PiCamera
from time import sleep

camera = PiCamera
camera.hflip = True #camera ad effetto specchio (flip orizzontale)

def registra_video():
    camera.start_recording('video.h264')
    camera.start_preview()

def stop_video():
    camera.stop_recording()
    camera.stop_preview()

while True:
    registra_video()