In [1]: import sys
In [2]: sys.path
Out[2]:
['',
'D:\\Program Files\\Python36\\Scripts\\ipython.exe',
'd:\\program files\\python36\\python36.zip',
'd:\\program files\\python36\\DLLs',
'd:\\program files\\python36\\lib',
'd:\\program files\\python36',
'C:\\Users\\Jam\\AppData\\Roaming\\Python\\Python36\\site-packages',
'd:\\program files\\python36\\lib\\site-packages',
'd:\\program files\\python36\\lib\\site-packages\\win32',
'd:\\program files\\python36\\lib\\site-packages\\win32\\lib',
'd:\\program files\\python36\\lib\\site-packages\\Pythonwin',
'd:\\program files\\python36\\lib\\site-packages\\IPython\\extensions',
'C:\\Users\\Jam\\.ipython']
In [3]: sys.path.append('test')
In [4]: sys.path
Out[4]:
['',
'D:\\Program Files\\Python36\\Scripts\\ipython.exe',
'd:\\program files\\python36\\python36.zip',
'd:\\program files\\python36\\DLLs',
'd:\\program files\\python36\\lib',
'd:\\program files\\python36',
'C:\\Users\\Jam\\AppData\\Roaming\\Python\\Python36\\site-packages',
'd:\\program files\\python36\\lib\\site-packages',
'd:\\program files\\python36\\lib\\site-packages\\win32',
'd:\\program files\\python36\\lib\\site-packages\\win32\\lib',
'd:\\program files\\python36\\lib\\site-packages\\Pythonwin',
'd:\\program files\\python36\\lib\\site-packages\\IPython\\extensions',
'C:\\Users\\Jam\\.ipython',
'test']
list的append不会又返回值,会直接操作list