Hi Ferdi, It is better to post such questions to the user list. As you've noticed I also answer mails there. But I'm not the only one, and you'll get access to a whole community. Besides, the posts get archived for future reference. Aside from that, it is commonly regarded impolite to address such mails personally to someone you don't know.
Anyway, the problem is that you provide python code on the command line, which has to follow the strict rules of python programming. Those are not Pymol commands. You have to indent each line properly, and systematically. After a ':' you always get a next level of indentation. Hope it helps, Tsjerk On Fri, Mar 5, 2010 at 5:14 PM, Ferdinand Alte <ferdinand.a...@ch.tum.de> wrote: > Hi Tsjerk, > > > > > > Forget my first email. I was being really stupid. I had forgotten to type > the following command: > > iterate <object name> & n. ca, print resn,resi,ss > > > > But again I have a problem: > > I can successfully copy & paste the following commands: > > > > iterate SH & n. ca, print resn,resi,ss > > class SSList:\ > > list = []\ > > def purge( self, resi, ss ):\ > > if not self.list or self.list[-1][0] != ss:\ > > self.list.append( [ss, resi, resi ] )\ > > else:\ > > self.list[-1][2] = resi\ > > def __repr__( self ):\ > > return "\n".join( map( self.repr_item, self.list ) )\ > > def repr_item( self, item ):\ > > > > > > > > But when I want to execute the next command, > > > > return item[0]+" ("+item[1]+"-"+item[2]+")" > > > > I get the following response: > > > > Traceback (most recent call last): > > File "C:\Program Files\DeLano Scientific\PyMOL/modules\pymol\parser.py", > line 260, in parse > > exec(layer.com2+"\n",self.pymol_names,self.pymol_names) > > File "<string>", line 2 > > list = [] > > ^ > > IndentationError: expected an indented block > > > > > > Can you tell me what is wrong here? > > > > > > Cheers, > > Ferdi -- Tsjerk A. Wassenaar, Ph.D. Computational Chemist Medicinal Chemist Neuropharmacologist ------------------------------------------------------------------------------ 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