newb question

lordkaos at my-deja.com lordkaos at my-deja.com
Tue Jul 18 02:29:14 EDT 2000


In article <3973EE1B.15B0B32E at mediaone.net>,
  Toy <gee308 at mediaone.net> wrote:
> what is a simple way I can save variables that people enter in from
> 'raw_input' ?  That way, someone enters the variables they want, then
> when the script is booted up everytime the machine starts, it will
grab
> the variables from somewhere.  Thanks.
> Jason Toy
> toyboy at toy.eyep.net
>
>
The tutorial at <a href="http://www.python.org/current/tut">Python's
website</a> tells a simple and easy way to do exactly what you're
saying. If you can get the variables into a class (read section 9, in
particular 9.3) then it is easy to read and write a big set of vars all
together in one operation by using the 'pickle' command (read about
this and easy file creation/opening in section 7.2). I just read over
this and it should answer your question. Come to think of it, raw_input
stores your input as a string, so you can just read() and write() in
one swipe to do the same thing (This would be much easier).

--Jared


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list