Pythonのお勉強 Part 26
■ このスレッドは過去ログ倉庫に格納されています
0459デフォルトの名無しさん
2008/05/23(金) 16:11:33Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> fn = os.path.join('./', 'test-file.txt')
>>> open(fn).read()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IOError: [Errno 2] No such file or directory: './test-file.txt'
同じディレクトリ下にあるファイルを読むにはどう書けば良いですか?
■ このスレッドは過去ログ倉庫に格納されています