すらいむがあらわれた

こまんど >  たたかう  にげる

IronPythonでファイル読み込み

こんな感じで .NET Frameworkのクラスを使えます。
まだPythonの文法がわかってないのでwhile文が変です…。


from System import *
from System.IO import *
from System.Text import *

shift_jis = Encoding.GetEncoding("Shift_JIS")
reader = StreamReader( "test.txt", shift_jis)

line = reader.ReadLine()
while line != None:
print line
line = reader.ReadLine()