Best practice for reusing python code [closed]
问题 I have write a python library app(which contains several *.py files). And several of my python projects need to reuse the code in the library app. What's the recommended best practice for reusing python code? Currently I have thought out three options: Copy and paste. This is far away from best practice. It violates the DRY principle.(Don't repeat yourself.) Add the folder of the library app to the environment variable PYTHONPATH: export PYTHONPATH=/path/to/library/app . Then every projects