Getting a Python program to run of off a flash drive?

rantingrick rantingrick at gmail.com
Wed Mar 31 19:00:46 EDT 2010


On Mar 31, 5:48 pm, Abethebabe <abrahamalra... at gmail.com> wrote:
> I wanted to know if there was a way I could get a Python program to
> run off of my flash drive as soon as the computer (Windows) detected
> the device?
>
> For example I could have a a simple program that would create a text
> document on the computers desktop when my flash drive is detected.

Well i sure hope your intentions are for the forces of good and NOT
the forces of evil. Anyway the beauty of USB is the fact you can read
and write to it just like any other file on your harddisc, unlike with
CD media where you need a CS degree and MS's blessing. So now the
question really is

""" How do i run a python script when i plug in my flash drive"""?

And thats a good question. Well it's going to involve "something"
watching and waiting for this (big hint) "event" to happen. Maybe
something like a "Flash Drive plug in watcher sevice" Do you have any
experience with win32 programming?



More information about the Python-list mailing list