RE: [PyMOL] Python commands and variables
Yes, but you need to write in Python directly. For example: from pymol import cmd cmd.select("mysel","none") for i in range(10,20): cmd.select("mysel","mysel or resi %d"%i) Would work in a ".py" file. Cheers, Warren -- mailto:war...@delanoscientific.com Warren L. DeLano, Ph.D. Principal Scientist DeLano Scientific LLC Voice (650)-346-1154 Fax (650)-593-4020 > -Original Message- > From: pymol-users-ad...@lists.sourceforge.net [mailto:pymol-users- > ad...@lists.sourceforge.net] On Behalf Of Shu-Hsien Sheu > Sent: Wednesday, August 27, 2003 1:10 PM > To: pymol-users@lists.sourceforge.net > Subject: [PyMOL] Python commands and variables > > Hi, > > I am new to Pymol with some experiences with Python. > I have a basic question which maybe a little stupid. > Does Pymal take Python commands in selecting atoms? > For instance: > > i = range(1, 299) > select resi i > > or, further: > for i in range(1, 299) > select resi i > > I understand the above can be easily done with: > select resi 1-288 > > However, I am wondering if variables can work in Pymol in general. > > Thanks! > > > > > > --- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > ___ > PyMOL-users mailing list > PyMOL-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pymol-users
[PyMOL] Python commands and variables
Hi, I am new to Pymol with some experiences with Python. I have a basic question which maybe a little stupid. Does Pymal take Python commands in selecting atoms? For instance: i = range(1, 299) select resi i or, further: for i in range(1, 299) select resi i I understand the above can be easily done with: select resi 1-288 However, I am wondering if variables can work in Pymol in general. Thanks!
Re: [PyMOL] Re: cannot find _cmd module
Hello, Ah, I see why now. I did do a full installation, during which the _cmd and sglite extension files, etc. were copied to C:\Python22\Lib\site-packages\pymol. According to comment in C:\Python22\Lib\site.py, a path configuration file must exist in the \site-packages directory indicating which sub-directories are to be appended to sys.path. So I added a file, pymol.pth in \site-packages that contains: # pymol package configuration pymol Now Python knows where to look for modules. And it works. Thanks so much! Tina - Original Message - From: "Warren L. DeLano" To: "'Tina Li'" ; Sent: Wednesday, August 27, 2003 2:32 PM Subject: RE: [PyMOL] Re: cannot find _cmd module | Tina, | | Did you do a full installation? After running: | | python setup.py build install | python setup2.py | | (in that order) | | pymol.bat should just work. There shouldn't be any need to copy | anything over, nor should you set PYMOL_PATH -- that is all taken care | of automatically with this approach. | | Cheers, | Warren | | | -- | mailto:war...@delanoscientific.com | Warren L. DeLano, Ph.D. | Principal Scientist | DeLano Scientific LLC | Voice (650)-346-1154 | Fax (650)-593-4020 | | > -Original Message- | > From: pymol-users-ad...@lists.sourceforge.net [mailto:pymol-users- | > ad...@lists.sourceforge.net] On Behalf Of Tina Li | > Sent: Wednesday, August 27, 2003 8:34 AM | > To: pymol-users@lists.sourceforge.net | > Subject: [PyMOL] Re: cannot find _cmd module | > | > Hello, | > | > So I figured that in my $PYMOL_PATH\build\lib.win32-2.2\pymol, there | is a | > _cmd.pyd that's missing in $PYMOL_PATH\modules\pymol. I copied it | over, | > and | > PyMOL started up, but said that it failed to import the xray module, | which | > however exists in $PYMOL_PATH\modules\pymol, so I don't understand why | it | > doesn't import that. Anyways, it seems to be up. I guess every time I | > build | > PyMOL, I'll have to copy the _cmd.pyd file over. | > | > Tina | > | > - Original Message - | > | From: "Tina Li" | > | To: | > | Date: Mon, 25 Aug 2003 11:57:27 -0400 | > | Subject: [PyMOL] cannot find _cmd module | > | | > | Hello, | > | | > | Eh, I think this is a rather basic question. So I built PyMOL on | Win32, | > tried | > | to run pymol.bat, which calls python | > $PYMOL_PATH/modules/pymol/__init__.py, | > | which complained: | > | | > | Traceback (most recent call last): | > | File "D:\thli\root\misc\pymol-0.90\modules\pymol\__init__.py", | line | > 92, in | > ? | > | import pymol | > | File "D:\thli\root\misc\pymol-0.90\modules\pymol\__init__.py", | line | > 300, | > in | > | ? | > | import _cmd | > | ImportError: No module named _cmd | > | | > | I have PYTHONPATH set to $PYMOL_PATH/modules. Is it something | obvious | > I'm | > | missing? | > | | > | Thanks much! | > | | > | Tina | > | > | > | > | > --- | > This sf.net email is sponsored by:ThinkGeek | > Welcome to geek heaven. | > http://thinkgeek.com/sf | > ___ | > PyMOL-users mailing list | > PyMOL-users@lists.sourceforge.net | > https://lists.sourceforge.net/lists/listinfo/pymol-users |
[PyMOL] Auto-launching in Mac Terminal
> I have a Mac TI powerbook running OSX. Every time I launch a new > terminal window, pymol launches. For example, if I open 3 terminal > windows, 3 pymol sessions also start. How do I stop this? What? You don't want PyMOL to launch every possible opportunity? Actually, I've encountered this problem myself -- very annoying... What happened is that you saved the Terminal window settings while you had a PyMOL session open, so OS X inferred that you were indicating a desire to have PyMOL open as a default preference. The only way I know of changing this is to text-edit $HOME/Library/Preferences/com.apple.Terminal.plist and remove the ExecutionString entry which contains PyMOL. That means deleting those two lines: the one which contains ExecutionString and the one with the PyMOL launch command. Sorry about this! Cheers, Warren
RE: [PyMOL] Re: cannot find _cmd module
Tina, Did you do a full installation? After running: python setup.py build install python setup2.py (in that order) pymol.bat should just work. There shouldn't be any need to copy anything over, nor should you set PYMOL_PATH -- that is all taken care of automatically with this approach. Cheers, Warren -- mailto:war...@delanoscientific.com Warren L. DeLano, Ph.D. Principal Scientist DeLano Scientific LLC Voice (650)-346-1154 Fax (650)-593-4020 > -Original Message- > From: pymol-users-ad...@lists.sourceforge.net [mailto:pymol-users- > ad...@lists.sourceforge.net] On Behalf Of Tina Li > Sent: Wednesday, August 27, 2003 8:34 AM > To: pymol-users@lists.sourceforge.net > Subject: [PyMOL] Re: cannot find _cmd module > > Hello, > > So I figured that in my $PYMOL_PATH\build\lib.win32-2.2\pymol, there is a > _cmd.pyd that's missing in $PYMOL_PATH\modules\pymol. I copied it over, > and > PyMOL started up, but said that it failed to import the xray module, which > however exists in $PYMOL_PATH\modules\pymol, so I don't understand why it > doesn't import that. Anyways, it seems to be up. I guess every time I > build > PyMOL, I'll have to copy the _cmd.pyd file over. > > Tina > > - Original Message - > | From: "Tina Li" > | To: > | Date: Mon, 25 Aug 2003 11:57:27 -0400 > | Subject: [PyMOL] cannot find _cmd module > | > | Hello, > | > | Eh, I think this is a rather basic question. So I built PyMOL on Win32, > tried > | to run pymol.bat, which calls python > $PYMOL_PATH/modules/pymol/__init__.py, > | which complained: > | > | Traceback (most recent call last): > | File "D:\thli\root\misc\pymol-0.90\modules\pymol\__init__.py", line > 92, in > ? > | import pymol > | File "D:\thli\root\misc\pymol-0.90\modules\pymol\__init__.py", line > 300, > in > | ? > | import _cmd > | ImportError: No module named _cmd > | > | I have PYTHONPATH set to $PYMOL_PATH/modules. Is it something obvious > I'm > | missing? > | > | Thanks much! > | > | Tina > > > > > --- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > ___ > PyMOL-users mailing list > PyMOL-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pymol-users
[PyMOL] Re: cannot find _cmd module
Hello, So I figured that in my $PYMOL_PATH\build\lib.win32-2.2\pymol, there is a _cmd.pyd that's missing in $PYMOL_PATH\modules\pymol. I copied it over, and PyMOL started up, but said that it failed to import the xray module, which however exists in $PYMOL_PATH\modules\pymol, so I don't understand why it doesn't import that. Anyways, it seems to be up. I guess every time I build PyMOL, I'll have to copy the _cmd.pyd file over. Tina - Original Message - | From: "Tina Li" | To: | Date: Mon, 25 Aug 2003 11:57:27 -0400 | Subject: [PyMOL] cannot find _cmd module | | Hello, | | Eh, I think this is a rather basic question. So I built PyMOL on Win32, tried | to run pymol.bat, which calls python $PYMOL_PATH/modules/pymol/__init__.py, | which complained: | | Traceback (most recent call last): | File "D:\thli\root\misc\pymol-0.90\modules\pymol\__init__.py", line 92, in ? | import pymol | File "D:\thli\root\misc\pymol-0.90\modules\pymol\__init__.py", line 300, in | ? | import _cmd | ImportError: No module named _cmd | | I have PYTHONPATH set to $PYMOL_PATH/modules. Is it something obvious I'm | missing? | | Thanks much! | | Tina
Re: [PyMOL] problems updating Mandrake packages
On 08/26/03 20:09:43, Malcolm Walker wrote: You are missing libz (which is strange, since libpng depends on libz) Oops, sorry. We fixed the problem. Somehow libpng got built without linking to zlib. Odd. Many thanks for your help. Austin -- Austin Acton Hon.B.Sc. Synthetic Organic Chemist, Teaching Assistant Department of Chemistry, York University, Toronto MandrakeClub Volunteer (www.mandrakeclub.com) homepage: www.groundstate.ca
Re: [PyMOL] problems updating Mandrake packages
On 08/26/03 20:09:43, Malcolm Walker wrote: You are missing libz (which is strange, since libpng depends on libz) You may need the development package too (zlib1-devel) [aus...@gamma373-165 austin]$ rpm -q zlib1 zlib1-1.1.4-8mdk [aus...@gamma373-165 austin]$ rpm -q zlib1-devel zlib1-devel-1.1.4-8mdk [aus...@gamma373-165 austin]$ pymol.com Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/pymol/__init__.py", line 92, in ? import pymol File "/usr/lib/python2.3/site-packages/pymol/__init__.py", line 300, in ? import _cmd ImportError: /usr/lib/libpng.so.3: undefined symbol: deflate It must have something to do with the upgrade to python 2.3... but we rebuilt all python containing packages since. Austin -- Austin Acton Hon.B.Sc. Synthetic Organic Chemist, Teaching Assistant Department of Chemistry, York University, Toronto MandrakeClub Volunteer (www.mandrakeclub.com) homepage: www.groundstate.ca