path - Sublime Text 2 and Repl - Run python -


i start using sublime text 2 , repl , got problems. when run file tells me file du not exist. script works perfect if build directly terminal.

code

def stopwords(text):     open('danish', 'ru') f:         line in f:             text = text.replace(' '+line.strip()+' ', "")     return text 

log

ioerror: [errno 2] no such file or directory: 'danish' 

i have tried things os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) reload(sys) , __file__ not work.

any ideas why __file__ don't work when running through sublime text 2 repl or file stored??


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -