Saving input data to a .txt file

Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jun 2008
Posts: 18
Reputation: JA5ONS is an unknown quantity at this point 
Solved Threads: 0
JA5ONS JA5ONS is offline Offline
Newbie Poster

Saving input data to a .txt file

 
0
  #1
Jun 4th, 2008
well, after the help i have had already tonight, i thought i might come ask another issue i am having with saving the file with the .txt extention.

i can save each file as the car model first name for each entry, however it wont put the .txt extention on the end. it just saves it as the file name and i have to choose to open with notepad.

my code is
  1. text_file = open(car_model, "w")

thanks for the help!!
Last edited by JA5ONS; Jun 4th, 2008 at 11:33 am.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 1,546
Reputation: Ene Uran has a spectacular aura about Ene Uran has a spectacular aura about 
Solved Threads: 174
Ene Uran's Avatar
Ene Uran Ene Uran is offline Offline
Posting Virtuoso

Re: Saving input data to a .txt file

 
0
  #2
Jun 4th, 2008
Try:
  1. text_file = open(car_model+".txt", "w")
drink her pretty
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for Python
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC