升华文本2和Repl运行python
我开始使用Sublime Text 2和REPL,但遇到了一些问题。 当我运行该文件时,它告诉我该文件不存在。如果脚本是直接从终端构建的,那么它就可以完美地工作 代码升华文本2和Repl运行python,python,path,sublimetext2,sublimerepl,Python,Path,Sublimetext2,Sublimerepl,我开始使用Sublime Text 2和REPL,但遇到了一些问题。 当我运行该文件时,它告诉我该文件不存在。如果脚本是直接从终端构建的,那么它就可以完美地工作 代码 def stopwords(text): with open('danish', 'rU') as f: for line in f: text = text.replace(' '+line.strip()+' ', "") return text 日志 IOError:
def stopwords(text):
with open('danish', 'rU') as f:
for line in f:
text = text.replace(' '+line.strip()+' ', "")
return text
日志
IOError: [Errno 2] No such file or directory: 'danish'
我尝试过类似于os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))和重新加载(sys)
和\uuu文件
的方法,但它们都不起作用
你知道为什么在运行Sublime Text 2 REPL时,\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu