python [Errno 2] No such file or directory: -


i learn python on ubuntu system. there errors shen tried read file .

fw = open(outfile,"a")  outfile = 'sougou/reduced/c000008_pre.txt'  ioerror: [errno 2] no such file or directory: 'sougou/reduced/c000008_pre.txt' 

without additional information, can see 2 possibilities here.

  1. the file trying access doesn't exist.

  2. the path file not correct relative location calling python script from.

try providing absolute path file, , see if fixes issue:

outfile = '/some/path/here/sougou/reduced/c000008_pre.txt' 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -