<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<STYLE type=text/css> <!--@import url(scrollbar.css); --></STYLE>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<STYLE>BLOCKQUOTE{margin-Top: 0px; margin-Bottom: 0px; margin-Left: 2em}; OL, UL{margin-Top: 0px; margin-Bottom: 0px}; p{margin-Top:0em; margin-Bottom:0px; padding:0px;}; </STYLE>
<META name=GENERATOR content="MSHTML 8.00.7600.16722"><BASE
target=_blank></HEAD>
<BODY
style="LINE-HEIGHT: 1.3; BORDER-RIGHT-WIDTH: 0px; MARGIN: 12px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px"
marginheight="0" marginwidth="0">
<DIV><FONT size=2 face="Times New Roman">
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-US><FONT size=3
face=Calibri>Dear sir:</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-US><?xml:namespace
prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p><FONT size=3
face=Calibri> </FONT></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-US><FONT size=3
face=Calibri>Your suggestions do work well! The problems have been resolved well
by your help. </FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-US><o:p><FONT
size=3 face=Calibri> </FONT></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-US><FONT size=3
face=Calibri>Thank you very much!</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-US><o:p><FONT
size=3 face=Calibri> </FONT></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-US><FONT size=3
face=Calibri>Best Wishes</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-US><o:p><FONT
size=3 face=Calibri> </FONT></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-US><FONT size=3
face=Calibri>Tao Cui </FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-US><FONT size=3
face=Calibri></FONT></SPAN> </P></FONT></DIV>
<DIV><FONT size=2 face="Times New Roman">
<HR>
</FONT></DIV>
<DIV><FONT size=2 face="Times New Roman"><STRONG>From:</STRONG>Eric
Pettersen</FONT></DIV>
<DIV><FONT size=2
face="Times New Roman"><STRONG>Date:</STRONG>2011-03-16 05:12</FONT></DIV>
<DIV><FONT size=2 face="Times New Roman"><STRONG>Subject:</STRONG>Re:
[chimera-dev] [Chimera-users] error: from DockPrep import prep</FONT></DIV>
<DIV><FONT size=2 face="Times New Roman"><STRONG>To:</STRONG>wascm</FONT></DIV>
<DIV><FONT size=2 face="Times New Roman"><STRONG>Cc:</STRONG>Greg
Couch,chimera-dev BB,UCSF Chimera Mailing List</FONT></DIV>
<DIV><FONT size=2 face="Times New Roman"></FONT> </DIV>
<DIV>
<DIV>
<DIV>On Mar 15, 2011, at 5:37 AM, wascm wrote:</DIV><BR
class=Apple-interchange-newline>
<BLOCKQUOTE type="cite">Dear sir:<BR><BR>Thanks for the detailed
reply!<BR><BR>When the following code was added to the start of
sciprt:<BR><BR><I>import chimeraInit<BR>chimeraInit.init(nogui=True,
silent=True)</I><BR><BR>The interpreter print the following confused error:
<BR><BR>---------------------------------------------<BR><I>Traceback (most
recent call last):<BR> File "./xx.py", line 5, in
<module><BR> chimeraInit.init(nogui=True,
silent=True)<BR>TypeError: init() takes at least 1 argument (2
given)</I><BR></BLOCKQUOTE>
<DIV><BR></DIV>There was an oversight in the code Greg provided:
chimeraInit.init takes a mandatory "argv" argument, which is exactly like
sys.argv.</DIV>
<DIV><BR>
<BLOCKQUOTE
type="cite">-----------------------------------------------<BR><BR>it's really
easy and convenient to running python script with chimera. The reason for i
want to run python script independently is that i want add some custom command
option. However, if i run python script with chimera, it's hard for me to add
some custom command option and handle it in the script though getopt
module.<BR><BR>For example, when i run some command like this:<BR><BR>chimera
–nogui test.py -t test<BR><BR>test.py<BR>###################
<BR>#!/usr/bin/python<BR><BR>t=None<BR><BR>try:<BR> opts,
args = getopt.getopt(sys.argv[1:], "t:")<BR>except getopt.GetoptError, err:
<BR> pass<BR>finally: <BR> for arg_k,
arg_v in opts:<BR> if (arg_k =="-t"):
t=arg_v<BR>####################################<BR><BR>This will raise running
exception!<BR><BR>is there a way for me to add the coustom option to python
script and run the script with chimera?</BLOCKQUOTE><BR></DIV>
<DIV>Yes. Use a --script argument, like this:</DIV>
<DIV><BR></DIV>
<DIV>chimera --nogui --script "test.py -t test"</DIV>
<DIV><BR></DIV>
<DIV>--Eric</DIV>
<DIV><BR></DIV><BR></DIV></BODY></HTML>