[Python] How to know/change current directory in Python shell?

>>> import os
>>> os.getcwd()
'/home/user'
>>> os.chdir("/tmp/")
>>> os.getcwd()
'/tmp'

import sys
print(sys.path)

Leave a Comment

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *