By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,708 Members | 1,570 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,708 IT Pros & Developers. It's quick & easy.

Auto execute python in USB flash disk

P: n/a
I am still fairly new to python and wanted to attempt a home made
password protection program. There are files that I carry on a USB
flash drive that I would like to password protect. Essentially, I
would like to password protect an entire directory of files. Is there
a way to auto execute a python script after a user double clicks to
open a folder on the USB drive? How can you capture that double click
event on a specific folder?

Thanks.

Mar 27 '07 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Ene
On Mar 27, 9:56 am, "Brian Erhard" <theema...@gmail.comwrote:
I am still fairly new to python and wanted to attempt a home made
password protection program. There are files that I carry on a USB
flash drive that I would like to password protect. Essentially, I
would like to password protect an entire directory of files. Is there
a way to auto execute a python script after a user double clicks to
open a folder on the USB drive? How can you capture that double click
event on a specific folder?

Thanks.
Install the free PortablePython from http://www.portablepython.com/ on
your USB
flash drive, and go from there.

Mar 27 '07 #2

P: n/a
On Mar 27, 11:56 am, "Brian Erhard" <theema...@gmail.comwrote:
I am still fairly new to python and wanted to attempt a home made
password protection program. There are files that I carry on a USB
flash drive that I would like to password protect. Essentially, I
would like to password protect an entire directory of files. Is there
a way to auto execute a python script after a user double clicks to
open a folder on the USB drive? How can you capture that double click
event on a specific folder?

Thanks.
I've never done this before, but it sounds cool. You would need to
create some kind of python file object to do this properly. So instead
of actually clicking a folder, you would click a pickled file or
something. I found some cool info about encrypting files here:

http://www.methods.co.nz/python/

There's also a python cryptography kit: http://www.amk.ca/python/writing/pycrypt/

Finally, I found a fellow python programmer that wrote his own:
http://mail.python.org/pipermail/pyt...il/378510.html

There's also PortablePython...

Enjoy!

Mike

Mar 27 '07 #3

P: n/a
Brian Erhard wrote:
Is there
a way to auto execute a python script after a user double clicks to
open a folder on the USB drive? How can you capture that double click
event on a specific folder?
That would depend on what desktop / Operating System you're
using. If it's Windows, you need a shell extension (which
is non-trivial to understand and write). If it's one of the
Linux desktops, someone else had better chip in!

TJG
Mar 27 '07 #4

P: n/a
>Is there
a way to auto execute a python script after a user double clicks to
open a folder on the USB drive? How can you capture that double click
event on a specific folder?

That would depend on what desktop / Operating System you're
using. If it's Windows, you need a shell extension (which
is non-trivial to understand and write). If it's one of the
Linux desktops, someone else had better chip in!
http://www.voidspace.org.uk/python/w..._15.shtml#e390
--------------------------------------------------
There is a new version of `Movable Python
<http://www.voidspace.org.uk/python/movpy/>`_
available.

This is available for **Movable Python** for Python 2.2.3, 2.3.5, 2.4.3
and 2.5rc2 from :

`The Movable Python Groups Page
<http://voidspace.tradebit.com/groups.php>`_

What is Movable Python
==================

Movable Python is a portable distribution of Python for windows,
designed to be run off a USB stick or computers that don't have Python
installed. It features an IDE (Pythonwin and IDLE are included - but
you can also use SPE), and a GUI launcher.

It can be configured to use multiple interpreters from a single
interface, including acting as a GUI for any executable.

It has a host of other features (like logging all output from files,
enabling psyco for all scripts, etc).

See the following link for a list of all the new features in Movable
Python 2.0.0 :
http://www.voidspace.org.uk/python/w..._15.shtml#e390

For an overview of the most important features (with screenshots) see :
http://www.voidspace.org.uk/python/w..._22.shtml#e396

Other uses for Movable Python include testing programs with different
versions of Python, and providing clean install 'sandboxes' for testing
programs. It is also an ideal launcher for IronPython.


--
Shane Geiger
IT Director
National Council on Economic Education
sg*****@ncee.net | 402-438-8958 | http://www.ncee.net

Leading the Campaign for Economic and Financial Literacy
Mar 27 '07 #5

P: n/a
Brian Erhard wrote:
I am still fairly new to python and wanted to attempt a home made
password protection program. There are files that I carry on a USB
flash drive that I would like to password protect. Essentially, I
would like to password protect an entire directory of files. Is there
a way to auto execute a python script after a user double clicks to
open a folder on the USB drive? How can you capture that double click
event on a specific folder?

Thanks.
Unless you are just doing this to learn, I would suggest you purchase
USB key with encryption included. They are REALLY cheap.

http://www.kingston.com/flash/DataTr...enterprise.asp

-Larry
Mar 27 '07 #6

P: n/a
"Ene" <En*****@yahoo.comwrites:
Install the free PortablePython from http://www.portablepython.com/
on your USB flash drive, and go from there.
To be clear: In addition to being a zero-cost download, Portable
Python is free software:

Python® distribution included in Portable Python is licensed under
PSF License, SciTE is licensed under SciTE license and Portable
Python scripts are licensed under GPL license.

<URL:http://www.portablepython.com/site/download/>

--
\ "I know when I'm going to die, because my birth certificate has |
`\ an expiration date." -- Steven Wright |
_o__) |
Ben Finney

Mar 27 '07 #7

P: n/a
Or take a look at http://www.truecrypt.org/ (Unless like Brain said,
you are doing this to learn)

On Mar 27, 11:17 pm, Larry Bates <lba...@websafe.comwrote:
Brian Erhard wrote:
I am still fairly new to python and wanted to attempt a home made
password protection program. There are files that I carry on a USB
flash drive that I would like to password protect. Essentially, I
would like to password protect an entire directory of files. Is there
a way to auto execute a python script after a user double clicks to
open a folder on the USB drive? How can you capture that double click
event on a specific folder?
Thanks.

Unless you are just doing this to learn, I would suggest you purchase
USB key with encryption included. They are REALLY cheap.

http://www.kingston.com/flash/DataTr...enterprise.asp

-Larry

Mar 28 '07 #8

This discussion thread is closed

Replies have been disabled for this discussion.