小编Fwi*_*er1的帖子

打开文件路径在python中不起作用

我正在编写一个数据库程序,personica 是我的测试对象(我通常会在文件路径的位置使用一个变量,但出于测试和演示目的,我只有一个字符串。)。在我的计算机上的这个确切位置有一个文本文件(顺便说一下,我在这里更改了我的用户名,因为我是偏执狂。),但它说:

Traceback (most recent call last):
File "C:\Users\Admin\Documents\Project 
Documentation\InteractiveExecutable.py", line 46, in <module>
ReadPerson = open("C:/Users/Admin/Documents/Project 
Documentation/personica.txt", 'r')
IOError: [Errno 2] No such file or directory:
'C:/Users/Admin/Documents/Project Documentation/personica.txt'
Run Code Online (Sandbox Code Playgroud)

这是代码行:

ReadPerson = open("C:/Users/Admin/Documents/Project Documentation/personica.txt", 'r')
Run Code Online (Sandbox Code Playgroud)

我确信它就在那里,当我将该地址复制到 Windows 资源管理器时,它会将我带到文本文件。

有谁知道为什么这不起作用?

python file

6
推荐指数
1
解决办法
2万
查看次数

随时可能将DroidCam视频流式传输到OpenCV Python

我目前在我的android上安装了Droid cam应用程序,它已被检测到并通过wifi(Droid Cam客户端)在Skype上流式传输。但是,无论我输入什么数字,它都不会流到OpenCV。

cap=cv2.VideoCapture()
Run Code Online (Sandbox Code Playgroud)

除此之外,我还有一个IP地址,请问有什么方法可以实现此目的,以便OpenCV可以从摄像机无线读取过程图像?我知道它甚至还没有开始读取相机,因为我已经使用以下代码对其进行了测试,每次运行它都会返回FALSE。

cap=cv2.Videocapture(0) #Use default cam
i=0
while(i<50):
    ret,frame=cap.read()
    print ret
Run Code Online (Sandbox Code Playgroud)

不断返回false,表示无法识别相机:L

python android opencv android-camera

3
推荐指数
2
解决办法
5479
查看次数

标签 统计

python ×2

android ×1

android-camera ×1

file ×1

opencv ×1