Set environment variables in python and environment variables in python
Method 1:
After the program is developed, you can add it
'/Library/Frameworks/Python. framework/Versions/3.4/lib/python3.4/site-packages'
Import sys, ossys. path ['', '/Library/Frameworks/Python. framework/Versions/3.4/lib/python34.zip ','/Library/Frameworks/Python. framework/Versions/3.4/lib/python3.4 ','/Library/Frameworks/Python. framework/Versions/3.4/lib/python3.4/plat-darwin', '/Library/Frameworks/Python. framework/Versions/3.4/lib/python3.4/lib-dynload ','/Library/Frameworks/Python. framework/Versions/3.4/lib/python3.4/site-packages ']
Method 1
Method 2:
Import sysimport ospre_path = OS. path. abspath ('/Users/Alan/desktop/Alanproject/day5/my_pj') # Set the environment variable and add the home directory to sys. path. file exit is invalid, so it is written to the main file sys. path. append (pre_path) from backend. logic import view, handleview. home () view. movie () handle. cal ()