[Newbie] - First Help

Super Bolo rlboloNOSPAM at libero.it
Sun Nov 5 07:46:33 EST 2000


Hi all,
here you will find my code of a software that should ask for Name and
Telephone Number and writes them to a file (i know that in this way it will
erase the file content each time but that's not the problem now).
The problem is that i can't get the interpreter to write both name and
number... why?? The error is "read-only carachter"... what's wrong??? Please
help.

Thank You,
Lorenzo

==============================
def chiedi():

                nome = raw_input ("Nome: ")
                numero = input ("Numero: ")
                file = open ('mydatafile.txt' , 'r+')
                file.write(nome , numero)
                file.close()

chiedi()

riprova = raw_input ("Vuoi immettere un altro nome? (Y/N) ")
if riprova == "Y":
                        chiedi()
else:
                        raw_input ("Arrivederci (Premi Invio)")

===========================================





More information about the Python-list mailing list