Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help
Special pages
SBGrid Resources
SBGrid Consortium
SBGrid Data Bank
Software Webinars
PyMOL Webinar
PyMOL Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Practical Pymol for Beginners
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
====Introduction and Very Simple Scripting==== Scripting in PyMOL ranges from very simple to very intricate. You can make a simple loop (say rotating a molecule one-degree at a time) or execute full featured scripts. Once you've got the basics of PyMOL down, learning scripting will greatly enhance your productivity and capabilities. Because of the way PyMOL is built on top of the Python interpreter, any command that PyMOL doesn't recognize it passes on to Python to execute. This is a '''very''' handy feature--you essentially have a live Python interpreter you can interact with, which makes your life much easier. Take the following for example: <source lang="python"> f = 10. for x in range(0,100,10): cmd.set("spec_direct_power", float(float(x) / f)) cmd.png("spec_dir_power" + str(x) + ".png", ray=1) </source> This simple script of 4 lines will create 10 images each one with the [[Spec_direct_power]] changed (see the [[Spec_direct_power]] for the output of this script; the animated GIF). Did you notice that '''f''' on line 1 and '''for''' and '''x''' on line 2 are not PyMOL commands or symbols? You can simply write Python code that interacts with PyMOL. Brilliant!
Summary:
Please note that all contributions to PyMOL Wiki are considered to be released under the GNU Free Documentation License 1.2 (see
PyMOL Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Practical Pymol for Beginners
(section)
Add topic