[Tutor] read cell phone's directory?
Chris “Kwpolska” Warrick
kwpolska at gmail.com
Thu Aug 14 10:09:23 CEST 2014
On Aug 14, 2014 9:30 AM, "= Clayton - Tang =" <ctny at ctny.org> wrote:
>
> Hi all,
>
> I am on WIndows and have an Android cell phone running Android 4.4.4.
>
> When I connect the phone to my PC using a micro-USB cable, the phone
appears next to the local hard drive under "This PC" window, then I can
browse the phone's directory like a regular disk. My goal is to find all
the photos on the phone then do something with the files. So I copied the
path from the File Explore navigation bar, which is 'This PC\Nexus
5\Internal storage\DCIM\Camera', but the follow code doesn't work.
>
> I get an error "W indowsError: [Error 3] The system cannot find the path
specified: 'This PC\\Nexus 5\\Internal storage\\DCIM\\Camera/*.*". Does
anyone know who to make it work?
This was recently discussed on the main list (python-list aka
comp.lang.python). Long story short, modern Android phones are using the
MTP protocol and do not behave like usual USB drives. You must use a module
that implements MTP if you want to access your phone.
> import os;
No need for a semicolon here.
--
Chris “Kwpolska” Warrick <http://chriswarrick.com/>
Sent from my SGS3.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20140814/f8f18fdf/attachment-0001.html>
More information about the Tutor
mailing list