現在の作業ディレクトリを設定するには?

Pythonでカレントワーキングディレクトリを設定するには?

ソリューション

os.chdir`を試す

OS.chdir(path) 現在の作業ディレクトリを path に変更します。利用可能です。Unix, Windows。

解説 (3)

もしかしたら、これはあなたが求めているものかもしれません。

import os
os.chdir(default_path)
解説 (0)
import os
print os.getcwd()  # Prints the current working directory

作業ディレクトリを設定するには

os.chdir('c:\\Users\\uname\\desktop\\python')  # Provide the new path here
解説 (7)