Click here to Skip to main content
15,904,877 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I wanna be able to stock a code that im entering in a file.txt so i can read/use it in a different python program. I just need to know the procedure, any code will do as an exemple, thanks! the thing is that i must be able to ask for what i want to stock in the file.txt

What I have tried:

I tried to create a text file but i dont know how to ask python to enter anything. I know how to create and import a text with read() and readlines() and stuff but if i have to ask python to enter something specific, i cant do that in text file since i need to use a python file to do that.
Posted
Updated 12-Jun-18 10:10am

1 solution

"I wanna": There is no such word as "wanna".

However, if you want to ask your user to enter the details then you need the input statement. See 7. Input and Output — Python 3.4.8 documentation[^] and 2. Built-in Functions — Python 3.4.8 documentation[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900