[python-win32] Python-win32 Digest, Vol 50, Issue 5

Tony Cappellini cappy2112 at gmail.com
Thu May 3 19:26:02 CEST 2007


When your program starts, take a snapshot of all the storage devices.
You can do this with a timer, every few seconds or so.

If the new snapshot changes from the original, you can call an API to
see if the new device is removable or not. This won't tell you if it's
a USB drive specifically, but for your situation, it may be highly
unlikely people would be connecting additionally floppy drives or
other removable devices.

You could also parse the output of a program called PCI32.exe and
check for new USB devices. PCI32 is free, produces text output only,
and can be called every few seconds (or whatever interval you feel is
appropriate)



Message: 1
Date: Thu, 3 May 2007 08:56:04 +0300
From: "Simon Dahlbacka" <simon.dahlbacka at gmail.com>
Subject: Re: [python-win32] Help needed : FindWindowEx
To: "Amit Arora" <Amit.Arora at infogain.com>
Cc: Roger Upole <rwupole at msn.com>, python-win32 at python.org
Message-ID:
       <57124720705022256y11a8d72fja136ab85070d38b9 at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

On 5/3/07, Amit Arora <Amit.Arora at infogain.com> wrote:
>
>  Exact Requirement :
> Need to write a Python script that keeps on running and when a USB device
> is plugged in , it detects the device and flashes a message on the propt or
> logs it to a file
> do suggest your ideas on this ........


More information about the Python-win32 mailing list