[Pipet Devel] more nice interfaces

Thomas.Sicheritz at molbio.uu.se Thomas.Sicheritz at molbio.uu.se
Mon Mar 1 04:20:07 EST 1999

 > > Questions:
 > >  * how can I combine a python module with a python class definition
 > >    I want to add python code to the c-module ...
 > Sorry, I don't understand what you are trying to do. Something
 > with Python and C and modules... Could you give a more detailed
 > description?

I have a c-module with functions bb_sequence.reverse,
bb_sequence.complement etc. and I want to create a class in python called
bb_sequence ... the original question was about how to add the c-module
into the class ... but I think I am going to rename the c-functions and
wrap them in the python code.

 > >  * how can I implement this tcl code in python ?
 > >    foreach i  "reverse coplement antiparallel" {
 > >        puts [eval bb_sequence.$i $seq]
 > >    }
 > I'd have to know what the Tcl code means! I suppose it's a loop
 > over three strings, which in Python is
 > for i in ["reverse" "coplement" "antiparallel"]:
 >     ....
 > But I don't understand the stuff with "puts" etc.

I'd like to evaluate variables with function names, like:
for i in ["reverse" "coplement" "antiparallel"]:
    print i,": ",bb_sequence.i

where bb_sequence.bb_sequence.i should be substituted/bound to 
reverse coplement and antiparallel

puts = print
and [eval bb_sequence.$i $seq] tells the tcl interpreter to substitute all
variables before evaluating the expression
e.g [eval bb_sequence.$i $seq] -> bb_sequence.reverse "actgactagctagcatcgatcgat"

Do we have access to a mailing list archieve ? - I have been away to long
from this list to keep an <what data structure/markup languages to use>
overview ...


Sicheritz Ponten Thomas E.  Department of Molecular Biology
blippblopp at linux.nu         BMC, Uppsala University
BMC:  +46 18 4714214        BOX 590 S-751 24 UPPSALA Sweden
Fax   +46 18  557723        http://evolution.bmc.uu.se/~thomas
Molecular Tcl:   http://evolution.bmc.uu.se/~thomas/tcl
Molecular Linux: http://evolution.bmc.uu.se/~thomas/mol_linux

	De Chelonian Mobile ... The Turtle Moves ...

More information about the Pipet-Devel mailing list