Is there a portable python interpreter that will run on Mac OS X 10.6 from a USB key?
I've been run开发者_JAVA技巧ning myself ragged trying to find a portable interpreter that I can run from a USB key on my work computer. Work comp is running Mac OS X 10.6, fairly restricted environment, no access to terminal, can't install apps but I do know that portable apps can be run from a USB drive. I've been using shell in a box to serve remote access to my comp at home over the web but out of respect for their network integrity I'd prefer not to. I've also just come across ideone.com which seems promising and I plan to give it a go tomorrow. Ideally though, I'd like to have the code running locally. Any help would be greatly appreciated by myself and, I'm sure, a few others that might be in the same situation.
Python is already on OS X. I would look at trying to find an editor/shell that will work from a usb drive.
If you don't have access to a terminal on the machine and can't install apps, using any Python is going to be problematic. The only useful out-of-the-box OS X GUI app provided by a standard Python build is IDLE.app. It should be possible to build a custom Python on OS X with a framework build and IDLE.app rooted on a disk image file system or on a USB drive. But you would have to do it yourself. Python framework builds on OS X are built to be installed to a specific path and, so, can't easily be moved once built. There are parameters to the configure script in the Python source distribution to specify the paths. See ./configure --help
and --enable-framework=
and --prefix=
and the like. You'll need to experiment a bit.
Perhaps a more interesting and robust idea would be to package IDLE or your own frontend shell window up with Python as a standalone app using py2app. py2app
already knows how to embed a Python framework into an app bundle so you'd just have to supply the frontend script. Lots of options there.
精彩评论