[Tutor] read cell phone's directory?

Danny Yoo dyoo at hashcollision.org
Thu Aug 14 14:19:03 CEST 2014


On Wed, Aug 13, 2014 at 7:07 PM, = 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.

Hmmm... there are a few things you may need to resolve.

1.  Backslashes have a meaning in Python string literals.  They mark
the beginning of an escape character sequence, to let programmers
represent strings that contain characters that are hard to otherwise
type.

See:

    http://learnpythonthehardway.org/book/ex10.html

2.  "This PC" may be simply a convenient name that Windows 8.1 is
using in its user interface.  It may be mapped to a different location
on your hard drive than a directory called "This PC".  Unfortunately,
I have no experience with Windows 8.1, so hopefully someone else might
be able to investigate.


More information about the Tutor mailing list