问题
通过os.system("dir")
更改目录后, os.chdir()
无法正常工作
代码
os.system("dir") # Works here
print(os.getcwd())
os.chdir("..")
print(os.getcwd())
os.system("dir") # Does not works here
输出
C:\Folder1\Folder2
Volume in drive C is Windows_OS
Volume Serial Number is 0000-0000
Directory of C:\Folder1\Folder2
08/08/2019 12:14 PM <DIR> .
08/08/2019 12:14 PM <DIR> ..
08/08/2019 12:14 PM <DIR> Files.txt
C:\Folder1
The system cannot find the path specified.