Dear Mr. Hall,
thank you very much for your help. This really works (I have tested it
now on windows).
Regards,
Petr Benes
2010/4/15 David Hall :
> I think you'll be saddened to discover that if you try what Petr (the
> original poster) was doing, sys.argv[0] won't work.
>
> $ cat test.py
> print sys.argv[0]
> $ pymol -qrc test.py
> PyMOL>run test.py,main
> /sw/lib/pymol-py26/modules/pymol/__init__.py
>
> This quite clearly gives the behavior that Petr had issues with.
>
> Instead, this is what is needed is a secret variable called
> pymol.__script__ e.g.:
> import pymol
> print pymol.__script__
>
> which can be parsed to give the directory component and such. For
> example, to get the directory name reliably:
> import pymol
> from os import path
> print path.dirname(path.abspath(pymol.__script__))
>
> I don't have the ability to test this on Windows, but it works on both
> Mac and Linux.
>
> -David
>
> On Thu, Apr 15, 2010 at 1:43 AM, Yerko Escalona
> wrote:
>> Hi
>> how do I determine the path of the script???
>> the answer is sys.argv[0]
>> for more information see this page
>> http://diveintopython.org/functional_programming/finding_the_path.html
>>
>> PS sorry for the mistake Jason Vertrees
>>
>> --
>> Yerko Ignacio Escalona Balboa
>> Ingeniero en Biotecnología Molecular
>> Universidad de Chile
>> http://zeth.ciencias.uchile.cl/~yescalona/
>>
>> --
>> Download Intel® Parallel Studio Eval
>> Try the new software tools for yourself. Speed compiling, find bugs
>> proactively, and fine-tune applications for parallel performance.
>> See why Intel Parallel Studio got high marks during beta.
>> http://p.sf.net/sfu/intel-sw-dev
>> ___
>> 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
>
--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
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