473,320 Members | 1,920 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Create new text file

3
hi, noobie here at python
heres the question. "The name of the file should be accepted as user input"
May 22 '07 #1
4 3192
ilikepython
844 Expert 512MB
hi, noobie here at python
heres the question. "The name of the file should be accepted as user input"
Ok...
Have you tried to start that?
May 22 '07 #2
oye
3
?? like wat i mean is wen the user enters sumthin with the raw_input command i then need to get that answer from raw_input and save the raw_input answer as a text file as the saved filename.
May 22 '07 #3
dshimer
136 Expert 100+
At the very simplest level you may want something like.
Expand|Select|Wrap|Line Numbers
  1. >>> name=raw_input('Filename?')
  2. >>> openfile=open(name,'w')
  3. >>> openfile.write('something to put in the file')
  4. >>> openfile.close()
  5.  
'w' is opening in write mode
May 22 '07 #4
oye
3
thanks exactly what i wanted.thankyou again
May 22 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Lauren Quantrell | last post by:
Is there a way to create a text file (such as a Windows Notepad file) by using a trigger on a table? What I want to do is to send a row of information to a table where the table: tblFileData has...
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
1
by: Andrew Chanter | last post by:
I am writing a little routine to perform the following operations from an Acces 97 mdb: 1. create a fixed width text file 2. create/establish a table type link to the text file in Access 3....
13
by: Dan V. | last post by:
How do I create a one line text file with these control codes? e.g.: 144 = 0x90 and 147 = 0x93? I am trying to create a one line text file with these characters all one one row with no spaces. ...
6
by: Chad Crowder | last post by:
Getting the following error on my production server whether the file exists or not: "System.IO.IOException: Cannot create a file when that file already exists." Here's the code generating the...
1
by: JenHu | last post by:
Hi experts, I want to create a new empty text file after I upload a file to the desination. Then I need to read each line from the uploaded file and write the lines which first character <>'6'...
6
by: windandwaves | last post by:
Hi Folk Some of my clients asked me to create "fancy emails" for them (aka html formatted emails). I know how to make a nice html document, but I had trouble creating a simple way to provide...
0
by: CSharpguy | last post by:
I have a web form that has 22 text boxes on it were the user can enter in data, then click a button that needs to create a text file. I can create the text file fine, but how can I create a text...
8
by: barb | last post by:
So that the world at large benefits from our efforts, here is one fully documented way to use Windows Irfanview freeware to create thumbnail web galleries (http://www.irfanview.com). STEP 1:...
15
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.