Jump to content

Saving User Input Python HELP!

TechFnatic
Go to solution Solved by Nineshadow,

Either store it in your RAM (bad idea), or use actual files that are stored on your drive.

 

How to read :
 

import string file = open("test.txt", 'r') lineFromFile = f.readline( ) file.close( )

How to write :

import string file = open("test.txt", 'w') file.write("Write this to file\n") file.close( )

How can I save user input in python, I'm relatively new and just dicking around atm. I'm making a login page where users are required to enter a username and password, once they enter the username and password I want the data to be stored so that they can re-use that same login info. Is there an BIF's that I don't know about that can help? Thanks

Link to comment
Share on other sites

Link to post
Share on other sites

Either store it in your RAM (bad idea), or use actual files that are stored on your drive.

 

How to read :
 

import string file = open("test.txt", 'r') lineFromFile = f.readline( ) file.close( )

How to write :

import string file = open("test.txt", 'w') file.write("Write this to file\n") file.close( )

i5 4670k @ 4.2GHz (Coolermaster Hyper 212 Evo); ASrock Z87 EXTREME4; 8GB Kingston HyperX Beast DDR3 RAM @ 2133MHz; Asus DirectCU GTX 560; Super Flower Golden King 550 Platinum PSU;1TB Seagate Barracuda;Corsair 200r case. 

Link to comment
Share on other sites

Link to post
Share on other sites

 

Either store it in your RAM (bad idea), or use actual files that are stored on your drive.

 

How to read :

 

import string file = open("test.txt", 'r') lineFromFile = f.readline( ) file.close( )

How to write :

import string file = open("test.txt", 'w') file.write("Write this to file\n") file.close( )

Thank you very much

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×