2

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\

In python I do:

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

I get:

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

Edit: 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.

More Than Five
  • 9,959
  • 21
  • 77
  • 127
  • I'm not familiar with recent Windows file systems, but noticed that the `phone_dir` seems to be a relative path. What if you change it to an absolute one? – neuront Jul 02 '13 at 10:20
  • 2
    I think you'll find that you aren't dealing with a mounted file system, but rather with an MTP device being shown as one. You might have some luck pursuing it via the windows API. This question appears to be somewhat relevant http://stackoverflow.com/q/11433978/ specifically the use of the media device manager SDK, http://msdn.microsoft.com/en-us/library/windows/desktop/ff801840(v=vs.85).aspx – Hasturkun Jul 02 '13 at 10:27
  • Not having much luck here. Is there anyway I can ask python for all root directories of a system and see if I can find the directory that way? – More Than Five Jul 02 '13 at 11:07
  • 1
    How are you connecting the phone to your laptop? USB? I don't have an Android, but most phones create a mount on your computer e.g. F: You would need to specify that mount point to access the device e.g. F:\Computer\GT-I9100\Phone\DCIM\Camera\ or F:\GT-I9100\Phone\DCIM\Camera\ – eandersson Jul 02 '13 at 12:07
  • 2
    "Computer" is not a file path, its an abstract top level of Windows Explorer. Its probably MTP related. – dilbert Jul 02 '13 at 12:47

0 Answers0