在python中获取我的电话目录 [英] Getting my phone directory in python

查看:53
本文介绍了在python中获取我的电话目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将Android手机连接到Windows笔记本电脑.在Windows资源管理器中,我的照片所在的目录是:

I connect my android phone to my windows laptop. In windows explorer the directory where my photos are is:

Computer\GT-I9100\Phone\DCIM\Camera\

在python中,我这样做:

In python I do:

phone_dir="Computer\GT-I9100\Phone\DCIM\Camera"
os.listdir(phone_dir) 

我得到:

FileNotFoundError: [WinError 3] The system cannot find the path specified: 'Computer\\GT-I9100\\Phone\\DCIM\\Camera\\*.*'

到目前为止,我最好的方法是在android设备上启用大容量存储,然后python可以看到它.但我不想不必这样做.因此,请保持开放性.

The best I have got so far is to enable mass storage on the android device and then python can see it. But I'd prefer not to have to do this. So will keep question open.

推荐答案

phone_dir = os.path.join('Computer', 'GT-I9100', 'Phone', 'DCIM', 'Camera')

这篇关于在python中获取我的电话目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆