[python-users] Zugriff aus Wechseldatenträger mit Python (Windows)

M.-A. Lemburg mal at egenix.com
Di Mär 1 11:41:43 CET 2016


On 01.03.2016 10:59, Joachim Sasse wrote:
> Hallo liebe Pythongemeinde,
> 
> ich habe das Problem, das ich zur Zeit keine Möglichkeit finde, um auf
> Wechseldatenträger unter Windows (USB-Verbundgerät) mit Python (3.5)  drauf zuzugreifen.
> 
> Ich habe z.b. ein Smartphone an USB angeschlossen, als Laufwerk ist es nicht zu erkennen.
> 
> die Lib psutil liefert mir nur die disk_partitions:
> z.B.
> [sdiskpart(device='C:\\', mountpoint='C:\\', fstype='NTFS', opts='rw,fixed'),
> sdiskpart(device='D:\\', mountpoint='D:\\', fstype='NTFS', opts='rw,fixed'),
> sdiskpart(device='E:\\', mountpoint='E:\\', fstype='NTFS', opts='rw,fixed'),
> sdiskpart(device='F:\\', mountpoint='F:\\', fstype='CDFS', opts='ro,cdrom'),
> sdiskpart(device='G:\\', mountpoint='G:\\', fstype='NTFS', opts='rw,fixed'),
> sdiskpart(device='H:\\', mountpoint='H:\\', fstype='NTFS', opts='rw,fixed'),
> sdiskpart(device='I:\\', mountpoint='I:\\', fstype='CDFS', opts='ro,cdrom'),
> sdiskpart(device='K:\\', mountpoint='K:\\', fstype='', opts='removable')]
> 
> Geht das evtl. mit pyusb ?  - da komme ich aber leider nicht weiter - bekomme nur eine Liste der
> Devices.

Das Smartphone meldet sich vermutlich als MTP oder PTP Gerät
an, nicht als mass storage device (UMS).

> Kann mir jemand helfen ?

Am einfachsten wäre vermutlich, die Einstellung am Smartphone zu
ändern.

Du kannst es aber auch mit einer dieser Libs versuchen:

https://pypi.python.org/pypi/PyMTP
https://pypi.python.org/pypi/wmdlib/

Erfahrung habe ich damit allerdings keine.

Beste Grüße,
-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Experts (#1, Mar 01 2016)
>>> Python Projects, Coaching and Consulting ...  http://www.egenix.com/
>>> Python Database Interfaces ...           http://products.egenix.com/
>>> Plone/Zope Database Interfaces ...           http://zope.egenix.com/
________________________________________________________________________
2016-02-19: Released eGenix PyRun 2.1.2 ...       http://egenix.com/go88

::: We implement business ideas - efficiently in both time and costs :::

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/
                      http://www.malemburg.com/




Mehr Informationen über die Mailingliste python-users