Hi all. I am very new at python and so i am having trouble with the simplest things, and i dont understand why this:
newfile = raw_input('what do you want to name your new file?')
text_file = open (newfile, "w")
isn't working. Can somebody explain it? Thankyou
Fetch
0
Newbie Poster
Recommended Answers
Jump to Postwell, you need to put the .txt extension at the end of the newFile input to get a text file
newfile = raw_input( 'What do you want to name your new file? ') text_file = open ( newfile, "w" ) line = raw_input( "Enter a line to …
Jump to Postwell, you need to put the .txt extension at the end of the newFile input to get a text file
Sorry, but that's absolutely not true. The file type is *not* distinguished by extension. (It's more of a hint on Windows, and irrelevant on Linux. Don't know about Mac, but …
All 5 Replies
masterofpuppets
pythopian
10
Junior Poster in Training
vegaseat
1,735
DaniWeb's Hypocrite
Team Colleague
Fetch
0
Newbie Poster
vegaseat
1,735
DaniWeb's Hypocrite
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.