Custom Python Packaging
Sandbox to try ThinkPy2 code
In https://github.com/kgisl/pythonFDP, in the /sandbox
directory, in your code, or in IDLE prompt, do this:
>> from thinkpy2.has_duplicates import *
>> has_duplicates([1, 2, 3, 1])
True
How it was created
-
This was created by following the instructions on https://j.mp/stepsPackage
-
After Steps 1-4:
/sandbox
/thinkpy2
__init__.py
# module files
setup.py
- Added to
setup.py
from setuptools import setup
setup(name='sandbox',
packages=['thinkpy2'],
)
- created a sample
some_code.py
withtest_fun
code in it.
Or even better, just skip all the above steps and simply use the script make_my_package.py
usage: python3 make_my_package.py <your_package_name>
-
At the level of the
/sandbox
directory, type:pip3 install -e .
That's it! You are all set!