Python

From PyMOLWiki
Revision as of 17:50, 19 May 2008 by Inchoate (talk | contribs) (New page: == DESCRIPTION == Issuing the '''Python''' command will put you into a stateful pseudo-interactive Python session. Or, more simply it's stateful in that you can invoke the Python sess...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

DESCRIPTION

Issuing the Python command will put you into a stateful pseudo-interactive Python session. Or, more simply it's stateful in that you can invoke the Python session write some code, end the session, then restart the session and your data will be saved (see Example 1). It's pseudo-interactive in that you don't get feedback until you type "python end," upon which your code is run the output appears.

This is a helpful command for testing different scripting or state-editing strategies for movie making.

USAGE

# start the session
python

# ...
# your Python code goes here
# ...

# end the session
python end


EXAMPLES

  • Start the session. Set x to 10. End the session. Restart the session and see if the value of x is recalled.
python
x = 10
print x
python end
python
print x
python end

Output:

10