# -*- coding: utf-8 -*- #python 27 #xiaodeng #修改模块搜索路径(注意:py运行完毕,就会失效,他只是临时产生效果) import sys print sys.path ‘‘‘ [‘C:\\Users\\Administrator\\Desktop‘, ‘C:\\Python27\\Lib\\idlelib‘, ‘C:\\Python27\\lib\\site-packages\\xlwt-1.0.0-py2.7.egg‘, ‘C:\\Python27\\lib\\site-packages\\requests-2.7.0-py2.7.egg‘, ‘C:\\Python27\\lib\\site-packages\\weibo-0.2.2-py2.7.egg‘, ‘C:\\Windows\\system32\\python27.zip‘, ‘C:\\Python27\\DLLs‘, ‘C:\\Python27\\lib‘, ‘C:\\Python27\\lib\\plat-win‘, ‘C:\\Python27\\lib\\lib-tk‘, ‘C:\\Python27‘, ‘C:\\Python27\\lib\\site-packages‘, ‘C:\\Python27\\lib\\site-packages\\PIL‘] ‘‘‘ #添加搜索路径 sys.path.append(‘C:\python‘) print sys.path #修改搜索路径 sys.path=[r‘C:\python‘] sys.path.append(‘C:\python\test‘) print sys.path#[‘C:\\python‘, ‘C:\\python\test‘]
时间: 2024-10-16 23:11:12