FileIO problem

Laszlo Zsolt Nagy gandalf at
Wed Aug 24 09:12:56 CEST 2005

Try this:

gclas = raw_input("What is the class:")
def Princlas():
    count = 0
    while count != 1000:
        count = count + 1
        return "Admin forceclass %s %s " % ( count , gclas )
#asks for file name
a = raw_input("What is new file name:")
out_file = open(a,"w")
#this is the input of text

>i know i need to get it to a string but i dont know how?

Your functions should RETURN a string, with the "return" statement.
Another issue: you cannot write the function itself, only its result:


instead of


More information about the Python-list mailing list