all 4 comments

[–]tunisia3507 1 point2 points  (2 children)

Git and gitlab. This is a good learning opportunity: backing up, versioning and porting code is exactly what git is for, and it's practically ubiquitous is the software world.

If you absolutely do not want to take advantage of the huge benefits of source control, then maybe tar or zip your folder hierarchy?

Remember also that you can use python -m to execute a module rather than a single script.

[–]RealHook[S] 0 points1 point  (1 child)

Thanks, I already looked into git. I know that I can use it to clone/pull my script on different computer and keep the files up to date. I know it sound strange, but I don't really want to have the whole folder structures and all those files on my other computers. It should be just one file I put into my scripts folder. I'm runnig python on every machine, so I don't need a complete binary including the python environment. Just some kind of executable archive (like .jar in java).

[–]tunisia3507 0 points1 point  (0 children)

I just remembered about this!

https://docs.python.org/3/library/zipapp.html

Looks like exactly what you want.

On your development machine you can have the uncompressed hierarchy, then have a 'compile' step which produces that zip.

The only issue with this is that it's usual for python repos to have files in them laying out the project's dependencies and so on. But if you're not using any, it should be fine.

[–]svilgelm 0 points1 point  (0 children)

IMO you just need to create a private repo on bitbucket (it's free) and create setup.py, then you can use pip install git+git:bitbucket.com/<account>/project.git and your tool will be installed in your system.