Pythonで現在の作業ディレクトリを設定するには?
922261 次
5 に答える
909
試すos.chdir
os.chdir(path)
現在の作業ディレクトリをパスに変更します。可用性: Unix、Windows。
于 2009-11-27T21:59:59.637 に答える
147
おそらくこれはあなたが探しているものです:
import os
os.chdir(default_path)
于 2009-11-27T22:00:09.700 に答える
60
import os
print os.getcwd() # Prints the current working directory
作業ディレクトリを設定するには:
os.chdir('c:\\Users\\uname\\desktop\\python') # Provide the new path here
于 2016-01-24T03:41:21.167 に答える
-11
pandas パッケージを使用している人々
import os
import pandas as pd
tar = os.chdir('<dir path only>') # do not mention file name here
print os.getcwd()# to print the path name in CLI
Python CLI でファイルをインポートするために使用される次の構文
dataset(*just a variable) = pd.read_csv('new.csv')
于 2016-12-22T06:12:56.530 に答える