Python:无法在Windows中打开两个相同的文件

时间:2017-11-28 15:37:31

标签: python

我的文件位于某个文件夹中。

string1 = 'E:/SenseableCloud/Emanuele/Projects/SEIR1/SEIR1/sf/data_0.0100_3.50_0.7_0.3_0.010000/run_0.csv'

a = pd.read_csv(string1)

它有效。然后我在另一个循环中有另一个相同的相同字符串,如下所示

string2 = 'E:/SenseableCloud/Emanuele/Projects/SEIR1/SEIR1/sf/data_0.0010_3.50_0.7_0.3_0.010000/run_0.csv'
b = pd.read_csv(string2)

我有以下错误:

IOError: File E:/SenseableCloud/Emanuele/Projects/SEIR1/SEIR1/sf/data_0.0010_3.50_0.7_0.3_0.010000/run_0.csv does not exist

1 个答案:

答案 0 :(得分:0)

他们不一样, 第一个包含'data_0.0100',另一个包含'data_0.0010'。 我用了

string1 = 'E:/SenseableCloud/Emanuele/Projects/SEIR1/SEIR1/sf/data_0.0100_3.50_0.7_0.3_0.010000/run_0.csv'
string2 = 'E:/SenseableCloud/Emanuele/Projects/SEIR1/SEIR1/sf/data_0.0010_3.50_0.7_0.3_0.010000/run_0.csv'

print(string1 == string2)

,结果是

False