[Tutor] Integer to String possible????
Daniel D. Laskey
dlaskey@laskeycpa.com
Sun, 20 Aug 2000 22:55:38 -0400
Albert:
I've had the same problem. I tried it and it works.
# --------------Answer1.py---------------------------
#
# create and empty data_file
# open the data file called data_file
data_file = raw_input('File to open? ')
in_file = open(data_file,"r")
# read the in_file
text = in_file.read()
# print the file to the screen
print text
# create the file to export the data to
# you need the double or single quotes around the name to save the file
out_file = open("new_file.txt","w+")
# write the new file you created to the file "new_file.txt"
out_file.write(text)
out_file.close()
in_file.close()
Keep working at it and sending in your questions. It helps me, too.
Dan
-----Original Message-----
From: Albert Antiquera [SMTP:gundamone@hotmail.com]
Sent: Sunday, August 20, 2000 3:27 PM
To: tutor@python.org
Subject: [Tutor] Integer to String possible????
Hi Guys,
From my last question I couldn't save to a txt file. I had some
improvements and I could save part of the result (strings) in to the text
file; but now I couldn't include the integer part because the
".writelines()"method doesn't like it. Is there a way to get around
this?Possibly a way to convert an Integer to a String?
Thanks,
Albert
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
_______________________________________________
Tutor maillist - Tutor@python.org
http://www.python.org/mailman/listinfo/tutor