Vivek,

you need to put the script in the directory from where you launched
pymol. I.e if you launched pymol from your home directory with pymol,
you need to place the script there. 

Pymol knows some basic shell like commands, like cd, ls, and may be some
more. Using these should get you were you want to be.

HTH

        Carsten

> -----Original Message-----
> From: Vivek Ranjan [mailto:vran...@gmail.com]
> Sent: Friday, July 09, 2010 1:47 PM
> To: Pymol
> Subject: [PyMOL] how to run a python script
> 
> Hello,
> 
> I am trying to run a simple python script from Pymol and cannot run
it:
> *******************************
> # axes.py
> from pymol.cgo import *
> from pymol import cmd
> from pymol.vfont import plain
> 
> # create the axes object, draw axes with cylinders coloured red,
green,
> #blue for X, Y and Z
> 
> obj = [
>    CYLINDER, 0., 0., 0., 10., 0., 0., 0.2, 1.0, 1.0, 1.0, 1.0, 0.0,
0.,
>    CYLINDER, 0., 0., 0., 0., 10., 0., 0.2, 1.0, 1.0, 1.0, 0., 1.0, 0.,
>    CYLINDER, 0., 0., 0., 0., 0., 10., 0.2, 1.0, 1.0, 1.0, 0., 0.0,
1.0,
>    ]
> 
> # add labels to axes object (requires pymol version 0.8 or greater, I
> # believe
> 
> cyl_text(obj,plain,[-5.,-5.,-
> 1],'Origin',0.20,axes=[[3,0,0],[0,3,0],[0,0,3]])
>
cyl_text(obj,plain,[10.,0.,0.],'X',0.20,axes=[[3,0,0],[0,3,0],[0,0,3]])
>
cyl_text(obj,plain,[0.,10.,0.],'Y',0.20,axes=[[3,0,0],[0,3,0],[0,0,3]])
>
cyl_text(obj,plain,[0.,0.,10.],'Z',0.20,axes=[[3,0,0],[0,3,0],[0,0,3]])
> 
> # then we load it into PyMOL
> cmd.load_cgo(obj,'axes')
> *******************************
> 
> I saved the above in a file named "axes.py" and put it in the same
> directory from where I type "pymol" (on ubuntu linux). Then I type
> "run axes.py" in pymol command bar. I get the following error message:
> 
> *****************************************
> Traceback (most recent call last):
>   File "/usr/local/lib/python2.6/dist-packages/pymol/parser.py", line
> 334, in parse
>     parsing.run_file(path,self.pymol_names,self.pymol_names)
>   File "/usr/local/lib/python2.6/dist-packages/pymol/parsing.py", line
> 455, in run_file
>     execfile(file,global_ns,local_ns)
> IOError: [Errno 2] No such file or directory: 'axes.py'
> *******************************************************************
> 
> Any help ?
> --
> Thank you and Regards,
> 
> Vivek Ranjan
> 
>
-----------------------------------------------------------------------
> -------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
> Archives:
http://www.mail-archive.com/pymol-users@lists.sourceforge.net


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net

Reply via email to