Python Setup.py

So, I'm neophile when creating and packaging python.

I got confused that my installation is viable and is there a better way to structure the code file for better packaging.

In essence, I have:

/top_folder/ |___setup.py |___file1.py |___file2.py |___lib/ <--- (FOLDER) |_____ binary1 |_____ libfile1.py |_____ libfile2.awk |_____ __init__.py 

Is the setup.py file as it is right to do something?

 setup( name='myName', version='1.0a', #packages=['lib'], url='http://myUrl.co.uk', license='GPL2', author='myAuthorName', author_email='myAuthorEmail', description='myDescription', py_modules=['file1', 'file2'] ) 
+4
source share
2 answers

Perhaps this will help the Open Sourcing Project Python . It covers not only the setup.py file, but also almost all tools and concepts.

+1
source

create a file to run this command:

python.exe build.py py2exe

Build.py should contain this (minus notes):

 from distutils.core import setup import py2exe 

Note. Any modules / libraries that need to be enabled (in this case timer.py is used) MODULE_LIST = ["timer"]

Note: 'bundle_files': 1' and zipfile = None compiles each into one exe without dependencies console = script will force your exe to run your python program as a script in the console. PyFindReplaceThreaded.py is the py file you want to create.

 setup( options = {'py2exe': {'bundle_files': 1}}, console = [{'script': "PyFindReplaceThreaded.py"}], zipfile = None, ) 
0
source

Source: https://habr.com/ru/post/1494169/


All Articles