所以伙计们,我发现了这个问题。 在我的代码中,我没有删除.csv文件扩展名,这就是问题所在。 感谢CL的建议,深入了解该文件的名称。
对于那些堆积类似问题的人,正确的代码是:
#as far as tkFileDialog returns absolute path to file, we have to slice from last slash till the end and also strip the extention! filename = fn[fn.rfind("/")+1:].strip('.csv')