Python

From Mesopoly 3.0
Revision as of 09:54, 26 September 2010 by Zlatko (talk | contribs)
Jump to navigation Jump to search

PyDev does not find file

PyDev does not find file to open, even it is in the same directory as script. Reports IOError: [Errno 2] No such file or directory: .. in console.

import os
fpp = os.path.join(os.path.abspath(os.curdir),'f.txt')
fp = open(fpp)
texti = fp.read()
fp.close()
print texti