Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


PySFX, a tool to create self-extracting Python scripts
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

PySFX, a tool to create self-extracting Python scripts

joepie91joepie91 Member, Patron Provider
edited March 2013 in General

It's still very much experimental, but seems to work fairly reliably already. I'm using it for CVM and will also be using it for pyLSA. It might come in handy for people wanting to deploy the same thing on a bunch of nodes :)

It basically lets you specify a single file (very much untested) or tar.gz as input (more tested), and creates a single .py file that, upon execution, will extract that data to a temporary directory and optionally autorun a command of choice. There are no dependencies on the extracting system other than the Python standard library and zlib (pretty much every system has this).

Example command:

tar -czf - * | pysfx -as "python test.py" - sfx.py

This will create an SFX file named sfx.py, that contains all the files (and folders) in the current directory, and it will run test.py on execution (after extracting). Do note that you need to specify the entire command to run, not just a .py file. For more help, run pysfx --help.

How to install: pip install pysfx (you might need to easy_install pip if you only have setuptools, or even apt-get install python-setuptools or yum install python-setuptools if you don't even have setuptools)

Source: https://github.com/joepie91/pysfx

Enjoy :)

Sign In or Register to comment.