[Tutor] Re-Naming an existent file

Ed Goulart ed at goulart.ws
Wed Oct 10 23:34:17 CEST 2007


Hello!
Though I've tried very hard, I couldn't find in the WEB the needed help; so,
if you can help me, please...!!!

*The problem is* that I need to rename a file (*qso.txt*) after a value
input "*call*" I get in the first line (<*call value*>*.txt*)* *...
I get the file qso.txt but I get no success in getting the file re-named to
<call value>.txt.
**
*call* = raw_input ( "-> CALL: " )
qso = call + "  " + raw_input( "-> QRA: " ) + "  " + raw_input( "-> RST: " )
+ "  " + raw_input( "-> QTH: " ) + "  " + raw_input( "-> OBS.: " )
f = file('qso.txt','w')          # open for 'w'riting
f.write(qso)                    # write text to file
f.close()                        # close the file

Thanks beforehand,
Ed Goulart,  ed at goulart.ws
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20071010/6aca0488/attachment.htm 


More information about the Tutor mailing list