Frage

I'd like to release one python script to other users for Linux OS.

I need to make sure the released script doesn't require other users to install the compatible version of python( maybe there is no python installed). This released script could also be modified and ran by other users.

I tried pyinstaller. It gave me two options: 1, release an executable, but the executable is not modifiable. 2, release a directory(I'm not quite sure the method) with a spec file but it looks like very complicated.

Is there any other better method I can release the script?

Thanks,

War es hilfreich?

Lösung

If you want no additional installation under every circumstance, one way or another you need to ship it with a python interpreter. So, in fact you are making the user install the interpreter in an unofficial fashion.

Most linux distributions come with Python nowadays, and you would get problems originating of version conflict very rarely if executed under the same major version. I'd say, just chmod the file appropriately, set the shebang and ship it.

If still insisting on your way, pyinstaller ought to have a way to bundle only the interpreter and binary dependencies together while having the original script stay in plain text, although I have done it under windows and not %100 percent sure it exists under linux.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top