c1rcle opened this issue on Sep 06, 2002 ยท 4 posts
ockham posted Fri, 06 September 2002 at 4:27 PM
Just to get you started, here's an extremely simple example of writing to a file. The Python documents are woefully short on such examples. # ------------------------------# import os Somefile = open('poo.txt','w') for i in range(10): ~PooString = "Index " + str(i) +"n" ~Somefile.write(PooString) Somefile.close() # -----------------------------# This will create a file named poo.txt in the same directory with Poser.exe, and write ten lines in the file: Index 0 Index 1 Index 2 Index 3 Index 4 Index 5 Index 6 Index 7 Index 8 Index 9 To read a file, you'd start with Somefile = open('poo.txt','r') and the loop might look something like: for i in range(10): ~Newstring[i] = Somefile.read()