|
From: Sadler, E. <ES...@do...> - 2008-02-28 14:48:20
|
I can run scripts by pasting them, but they fail when I try to read them
from a file, as in:
PyMOL> run ~/scriptfolder/rasmolify.py
This generates lots of errors:
Traceback (most recent call last):
File "/Applications/MacPyMOL.app/pymol/modules/pymol/parser.py", line 333,
in parse
parsing.run_file(exp_path(layer.args[0]),self.pymol_names,self.pymol_names)
File "/Applications/MacPyMOL.app/pymol/modules/pymol/parsing.py", line
456, in run_file
execfile(file,global_ns,local_ns)
File "/Users/evansadler/pymolscripts/rasmolify.py", line 3
^
SyntaxError: invalid syntax
Some result for MacPyMOL and X11 hybrid
What am I doing wrong?
Evan
--
J. Evan Sadler, M.D., Ph.D.
Howard Hughes Medical Institute
Washington University
660 S. Euclid Ave., Box 8022
St. Louis, MO 63110
Tel: 314-362-9067
FAX: 314-454-3012
email: es...@wu...
|
|
From: gilleain t. <gil...@gm...> - 2008-02-29 04:02:11
|
Hmm. Running scripts has always worked for me on a mac. Could it be a tab/space problem, or just a character missing at the end from a copy/paste? gilleain torrance On Thu, Feb 28, 2008 at 2:50 PM, Sadler, Evan <ES...@do...> wrote: > I can run scripts by pasting them, but they fail when I try to read them > from a file, as in: > > PyMOL> run ~/scriptfolder/rasmolify.py > > This generates lots of errors: > > Traceback (most recent call last): > File "/Applications/MacPyMOL.app/pymol/modules/pymol/parser.py", line 333, > in parse > > parsing.run_file(exp_path(layer.args[0]),self.pymol_names,self.pymol_names) > File "/Applications/MacPyMOL.app/pymol/modules/pymol/parsing.py", line > 456, in run_file > execfile(file,global_ns,local_ns) > File "/Users/evansadler/pymolscripts/rasmolify.py", line 3 > > ^ > SyntaxError: invalid syntax > > Some result for MacPyMOL and X11 hybrid > > What am I doing wrong? > > Evan > -- > J. Evan Sadler, M.D., Ph.D. > Howard Hughes Medical Institute > Washington University > 660 S. Euclid Ave., Box 8022 > St. Louis, MO 63110 > Tel: 314-362-9067 > FAX: 314-454-3012 > email: es...@wu... > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > PyMOL-users mailing list > PyM...@li... > https://lists.sourceforge.net/lists/listinfo/pymol-users > |
|
From: Sadler, E. <ES...@do...> - 2008-02-29 15:14:03
|
That sounds reasonable to me but I know next to nothing about python. Maybe I should have included the misbehaving script, which was taken directly from the PyMOL wiki script library: ## This is just a quick hack. For something more meaty see; ## http://arcib.dowling.edu/sbevsl/ ## Version 0.0.00-000/1 ## Turn off the virtual_trackball cmd.set("virtual_trackball", "off") ## spacefill def spacefill(p1=''): if(p1=='off'): cmd.hide("spheres") elif(p1==''): cmd.show("spheres") else: print("feh!") cmd.extend("spacefill", spacefill) ## cartoon def cartoon(p1=''): if(p1=='off'): cmd.hide("cartoon") elif(p1==''): cmd.show("cartoon") else: print("feh!") cmd.extend("cartoon", cartoon) ## wireframe def wireframe(p1=''): if(p1=='off'): cmd.hide("lines") elif(p1==''): cmd.show("lines") else: print("feh!") cmd.extend("wireframe", wireframe) ## exit def exit(): cmd.quit() cmd.extend("exit", exit) Any part of it works fine when pasted, but no part works when invoked by "run..." Evan On 2/28/08 10:02 PM, "gilleain torrance" <gil...@gm...> wrote: Hmm. Running scripts has always worked for me on a mac. Could it be a tab/space problem, or just a character missing at the end from a copy/paste? gilleain torrance On Thu, Feb 28, 2008 at 2:50 PM, Sadler, Evan <ES...@do...> wrote: > I can run scripts by pasting them, but they fail when I try to read them > from a file, as in: > > PyMOL> run ~/scriptfolder/rasmolify.py > > This generates lots of errors: > > Traceback (most recent call last): > File "/Applications/MacPyMOL.app/pymol/modules/pymol/parser.py", line 333, > in parse > > parsing.run_file(exp_path(layer.args[0]),self.pymol_names,self.pymol_names) > File "/Applications/MacPyMOL.app/pymol/modules/pymol/parsing.py", line > 456, in run_file > execfile(file,global_ns,local_ns) > File "/Users/evansadler/pymolscripts/rasmolify.py", line 3 > > ^ > SyntaxError: invalid syntax > > Some result for MacPyMOL and X11 hybrid > > What am I doing wrong? > > Evan > -- > J. Evan Sadler, M.D., Ph.D. > Howard Hughes Medical Institute > Washington University > 660 S. Euclid Ave., Box 8022 > St. Louis, MO 63110 > Tel: 314-362-9067 > FAX: 314-454-3012 > email: es...@wu... > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > PyMOL-users mailing list > PyM...@li... > https://lists.sourceforge.net/lists/listinfo/pymol-users > ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ PyMOL-users mailing list PyM...@li... https://lists.sourceforge.net/lists/listinfo/pymol-users |
|
From: DeLano S. <de...@de...> - 2008-02-29 19:20:39
|
Evan, Hmm -- the code you posted seems to work just fine with the "run" command when saved as a text file, so my next guess is that perhap you're saving the script as something other than text? (RTF perhaps?) HINT: If using TextEdit, select "Make Plain Text" from the Format menu. Cheers, Warren -- DeLano Scientific LLC Subscriber Support Services mailto:de...@de... _____ From: pym...@li... [mailto:pym...@li...] On Behalf Of Sadler, Evan Sent: Friday, February 29, 2008 7:17 AM To: gilleain torrance; pymol-users Subject: Re: [PyMOL] Scripts on Mac That sounds reasonable to me but I know next to nothing about python. Maybe I should have included the misbehaving script, which was taken directly from the PyMOL wiki script library: ## This is just a quick hack. For something more meaty see; ## http://arcib.dowling.edu/sbevsl/ ## Version 0.0.00-000/1 ## Turn off the virtual_trackball cmd.set("virtual_trackball", "off") ## spacefill def spacefill(p1=''): if(p1=='off'): cmd.hide("spheres") elif(p1==''): cmd.show("spheres") else: print("feh!") cmd.extend("spacefill", spacefill) ## cartoon def cartoon(p1=''): if(p1=='off'): cmd.hide("cartoon") elif(p1==''): cmd.show("cartoon") else: print("feh!") cmd.extend("cartoon", cartoon) ## wireframe def wireframe(p1=''): if(p1=='off'): cmd.hide("lines") elif(p1==''): cmd.show("lines") else: print("feh!") cmd.extend("wireframe", wireframe) ## exit def exit(): cmd.quit() cmd.extend("exit", exit) Any part of it works fine when pasted, but no part works when invoked by "run..." Evan On 2/28/08 10:02 PM, "gilleain torrance" <gil...@gm...> wrote: Hmm. Running scripts has always worked for me on a mac. Could it be a tab/space problem, or just a character missing at the end from a copy/paste? gilleain torrance On Thu, Feb 28, 2008 at 2:50 PM, Sadler, Evan <ES...@do...> wrote: > I can run scripts by pasting them, but they fail when I try to read them > from a file, as in: > > PyMOL> run ~/scriptfolder/rasmolify.py > > This generates lots of errors: > > Traceback (most recent call last): > File "/Applications/MacPyMOL.app/pymol/modules/pymol/parser.py", line 333, > in parse > > parsing.run_file(exp_path(layer.args[0]),self.pymol_names,self.pymol_names) > File "/Applications/MacPyMOL.app/pymol/modules/pymol/parsing.py", line > 456, in run_file > execfile(file,global_ns,local_ns) > File "/Users/evansadler/pymolscripts/rasmolify.py", line 3 > > ^ > SyntaxError: invalid syntax > > Some result for MacPyMOL and X11 hybrid > > What am I doing wrong? > > Evan > -- > J. Evan Sadler, M.D., Ph.D. > Howard Hughes Medical Institute > Washington University > 660 S. Euclid Ave., Box 8022 > St. Louis, MO 63110 > Tel: 314-362-9067 > FAX: 314-454-3012 > email: es...@wu... > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > PyMOL-users mailing list > PyM...@li... > https://lists.sourceforge.net/lists/listinfo/pymol-users > ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ PyMOL-users mailing list PyM...@li... https://lists.sourceforge.net/lists/listinfo/pymol-users |