https://pymolwiki.org/index.php?title=Get_object_list&feed=atom&action=history
Get object list - Revision history
2024-03-28T09:41:54Z
Revision history for this page on the wiki
MediaWiki 1.35.7
https://pymolwiki.org/index.php?title=Get_object_list&diff=12545&oldid=prev
Speleo3: print syntax for python 2+3
2017-03-06T17:10:12Z
<p>print syntax for python 2+3</p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 17:10, 6 March 2017</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l19" >Line 19:</td>
<td colspan="2" class="diff-lineno">Line 19:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><source lang="python"></div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><source lang="python"></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>PyMOL> fetch 2x19 2xwu 1d7q, async=0</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>PyMOL> fetch 2x19 2xwu 1d7q, async=0</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>PyMOL> print cmd.get_object_list('solvent')</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>PyMOL> print<ins class="diffchange diffchange-inline">(</ins>cmd.get_object_list('solvent'<ins class="diffchange diffchange-inline">)</ins>)</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>['2x19', '2xwu']</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>['2x19', '2xwu']</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>PyMOL> print cmd.get_object_list('hydro')</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>PyMOL> print<ins class="diffchange diffchange-inline">(</ins>cmd.get_object_list('hydro'<ins class="diffchange diffchange-inline">)</ins>)</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>['1d7q']</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>['1d7q']</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>PyMOL> print cmd.get_object_list('2x*') # FAIL!!!</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>PyMOL> print<ins class="diffchange diffchange-inline">(</ins>cmd.get_object_list('2x*'<ins class="diffchange diffchange-inline">)</ins>) # FAIL!!! <ins class="diffchange diffchange-inline">(fixed in PyMOL 1.7.6)</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>['2x19']</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>['2x19']</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>PyMOL> print cmd.get_object_list('(2x*)') # correct, with parenthesis</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>PyMOL> print<ins class="diffchange diffchange-inline">(</ins>cmd.get_object_list('(2x*)'<ins class="diffchange diffchange-inline">)</ins>) # correct, with parenthesis</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>['2x19', '2xwu']</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>['2x19', '2xwu']</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></source></div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></source></div></td></tr>
</table>
Speleo3
https://pymolwiki.org/index.php?title=Get_object_list&diff=10597&oldid=prev
Speleo3: created
2012-03-26T14:26:47Z
<p>created</p>
<p><b>New page</b></p><div>'''cmd.get_object_list''' is an API only command which returns the list of all molecular objects in selection. It will not return selection names or objects which are not of type molecule.<br />
<br />
== PyMOL API ==<br />
<br />
<source lang="python"><br />
list cmd.get_object_list(string selection='(all)')<br />
</source><br />
<br />
''Important: Always put the selection in parenthesis to force PyMOL to interpret it as an atom selection. Otherwise this might fail on name wildcards, groups, etc.''<br />
<br />
For proper atom selections this should be identical to:<br />
<br />
<source lang="python"><br />
list cmd.get_names('objects', 0, string selection='(all)')<br />
</source><br />
<br />
== Examples ==<br />
<br />
<source lang="python"><br />
PyMOL> fetch 2x19 2xwu 1d7q, async=0<br />
PyMOL> print cmd.get_object_list('solvent')<br />
['2x19', '2xwu']<br />
PyMOL> print cmd.get_object_list('hydro')<br />
['1d7q']<br />
PyMOL> print cmd.get_object_list('2x*') # FAIL!!!<br />
['2x19']<br />
PyMOL> print cmd.get_object_list('(2x*)') # correct, with parenthesis<br />
['2x19', '2xwu']<br />
</source><br />
<br />
== See Also ==<br />
<br />
* [[get_names]]<br />
* [[get_names_of_type]]<br />
<br />
[[Category:Scripting]]</div>
Speleo3