2012-02-25から1日間の記事一覧
python には、with というファイルのIO 関連のステートメントがある。ex. try: f = open('hoge', 'w') print('This is ', file=f) except IOError as err: print('File IO Error : ' + str(err)) finally: if 'f' in locales(): f.close() これは、下のよう…
python には、with というファイルのIO 関連のステートメントがある。ex. try: f = open('hoge', 'w') print('This is ', file=f) except IOError as err: print('File IO Error : ' + str(err)) finally: if 'f' in locales(): f.close() これは、下のよう…