Robust way to ensure other people can run my python program

前端 未结 8 1365
醉酒成梦
醉酒成梦 2021-02-13 00:26

I wish to place a python program on GitHub and have other people download and run it on their computers with assorted operating systems. I am relatively new to python but have u

8条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-13 00:53

    Have you considered setting up a setup.py file? It's a handy way of bundling all of your... well setup into a single location. So all your user has to do is A) clone your repo and B) run pip install . to run the setup.py

    There's a great stack discussion about this.

    As well as a handle example written by the requests guy.

    This should cover most use cases. Now if you want to make it truly distributable then you'll want to look into setting it up in PyPi, the official distribution hub.

    Beyond that if you're asking how to make a program "OS independent" there isn't a one size fits all. It depends on what you are doing with your code. Requires researching how your particular code interacts with those OS's etc.

提交回复
热议问题