save class

Diez B. Roggisch deets at nospam.web.de
Fri Jun 15 06:19:37 EDT 2007


> of having to keep track of a separate dictionary file. I am new to
> this, but I thought that this would be a regular thing to do in
> python, because people must make classes in the interactive console
> and then export them somehow for later use.

No. That's not how things work. One does dabble with the interpreter a 
bit, sometimes even creating a tiny class.

But except from the occasional expression tested in the interpreter, 
it's not common to use that code and save it.

Write python-files from the start. Then either execute them

python myfile.py

or if you insist, do


python

 >>> import myfile
 >>> myfile.some_function()


Diez



More information about the Python-list mailing list