This is a read-only mirror of pymolwiki.org

Difference between revisions of "Key Wait"

From PyMOL Wiki
Jump to navigation Jump to search
 
m (5 revisions)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
<source lang="python">
 
<source lang="python">
#use "spawn spawn_demo.py, local" to invoke this python script from
+
#use "spawn spawn_demo.py, local" to invoke this
within pymol
+
#python script from within PyMOL
 +
 
 
wait=""
 
wait=""
 
i=0
 
i=0
Line 12: Line 13:
 
</source>
 
</source>
  
[[Category:Scripting_Script_Library|Key Wait]]
+
''Note: this approach only works when you have a console window open.''
 +
[[Category:Script_Library|Key Wait]]
 +
[[Category:UI_Scripts]]

Latest revision as of 01:47, 28 March 2014

#use "spawn spawn_demo.py, local" to invoke this
#python script from within PyMOL

wait=""
i=0
while i < 12 and wait!="x":
  cmd.turn("y", 30)
  print "Press enter key to continue or x + enter to terminate"
  wait=raw_input()
  i=i+1
print "Done"

Note: this approach only works when you have a console window open.