En Thu, 12 Feb 2009 07:07:53 -0200, WP <no.i.d...@want.mail.from.spammers.com> escribió:

Hello group! This is probably a silly newbie mistake but consider the following program:

import libsbml

def getSBMLModel(biomodel_path):
     reader = libsbml.SBMLReader()

     sbml_doc = reader.readSBML(biomodel_path)
     sbml_model = None

     if sbml_doc.getNumErrors() > 0:
         print 'I couldn\'t read the file %s!' % biomodel_path
         return None
     else:
         sbml_model = sbml_doc.getModel()

     return sbml_doc.getModel() # None if file couldn't be opened

Note that sbml_doc.getModel() is called *twice*, the first one is discarded. Probably you want to replace the last line with: return sbml_model

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to