[Biopython-dev] Bio.Nexus

Frank Kauff fkauff at duke.edu
Sun Feb 20 17:05:56 EST 2005


On Sun, 2005-02-20 at 18:42 +0900, Michiel Jan Laurens de Hoon wrote:
> Frank Kauff wrote:
> > Hi Michiel,
> > 
> > On Fri, 2005-02-18 at 12:59 +0900, Michiel Jan Laurens de Hoon wrote:
> > 
> >>Bio/Nexus/cnexus.c contains a "main" function that doesn't seem to be needed in 
> >>Biopython. Can I remove it? Since this function is exported, it may (in theory 
> >>at least) cause a conflict. Also, my compiler complains about it that "int main" 
> >>doesn't return an int.
> >>
> > 
> > 
> > Not sure -  I simply strictly followed the Python documentation about
> > extensions: http://docs.python.org/ext/methodTable.html, because it's
> > the first extension I've ever written :-) The docs say that I need the
> > main function for calling the initialization function that passes the
> > method table to the interpreter.
> 
> You need the "main" function when you're embedding python (so when you write 
> your own program that contains the Python interpreter). Here you're extending 
> python, so you don't need the main function. The initialization function is 
> calling by the Python interpreter when you import your module.
> 

Still I don't really get it - using the main() function is what's
described in the python docs as the thing to do when extending. But it
seems to work without from within Biopython, but not when I just keep
the files somewhere else and import them from there (as done during
develpment of cnexus and the rest of the parser).
Anyway, when it works without main() from Bio.Nexus, it's fine with me
to remove it.

Frank

> --Michiel.
> 
-- 
Frank Kauff
Dept. of Biology
Duke University
Box 90338
Durham, NC 27708
USA

Phone 919-660-7382
Fax 919-660-7293
Web http://www.lutzonilab.net/member/frankkauff.shtml







More information about the Biopython-dev mailing list