Python modules

Create an file in each directory that will be in the tree of your import. For example, if you have the following directory structure…


…you would issue the following commands:

export PYTHONPATH=$PYTHONPATH:/opt/software
touch /opt/software/com/
touch /opt/software/com/yourcompany/
touch /opt/software/com/yourcompany/yourdivision/

You should be able to run the following successfully…

python -c "import com.yourcompany.yourdivision.yourfile"

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.