导入模块import sys1.print(sys.path)#打印环境变量输出:['D:\\WorkSpace\\Python\\Day1', 'D:\\WorkSpace\\Python', 'D:\\SoftWare\\Anaconda\\python35.zip', 'D:\\SoftWare\\Anaconda\\DLLs', 'D:\\SoftWare\\Anaconda\\lib', 'D:\\SoftWare\\Anaconda', 'D:\\SoftWare\\Anaconda\\lib\\site-packages', 'D:\\SoftWare\\Anaconda\\lib\\site-packages\\Sphinx-1.4.6-py3.5.egg', 'D:\\SoftWare\\Anaconda\\lib\\site-packages\\win32', 'D:\\SoftWare\\Anaconda\\lib\\site-packages\\win32\\lib', 'D:\\SoftWare\\Anaconda\\lib\\site-packages\\Pythonwin', 'D:\\SoftWare\\Anaconda\\lib\\site-packages\\setuptools-27.2.0-py3.5.egg']python的全局环境变量,内部文件调用的第三方库的存放位置:'D:\\SoftWare\\Anaconda\\lib\\site-packages'标准库的存放位置:'D:\\SoftWare\\Anaconda\\lib\\‘注释:自己编写的Py文件可以存放在第三方库的位置,Import可以直接调用模块。re:正则threading:多线程
2.print(sys.argv)打印脚本文件的相对路径输出:['D:/WorkSpace/Python/Day1/sys_mod.py'](Pycharm中是绝对路径,所以打印出了绝对路径)
转载于:https://www.cnblogs.com/huoxiang/p/7325046.html