Hi, 
I'm trying to write program using Python, PySide and openbabel, but some
things are strange: in GUI-application I can't obtain Atom.atomicmass value.

Code below gives masses about e-315


#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from PySide  import QtCore
from PySide import QtGui
import pybel

app = QtGui.QApplication(sys.argv)
window = QtGui.QMainWindow()
window.show()
   
tt = 'C(CO)CS'
mol = pybel.readstring("smi",tt)
atoms =  mol.atoms
for atom in atoms:
  print atom.atomicmass, atom.atomicnum, atom.exactmass
mwt=mol.molwt
print tt + ' Molecular weight is: ' + str(mwt)

sys.exit(app.exec_())


Without "app" part all is OK. 
(I'm using python-openbabel 2.2.3-1build1 from Ubuntu repos)



-- 
View this message in context: 
http://forums.openbabel.org/Python-Qt-and-openbabel-atomicmass-error-tp3264710p3264710.html
Sent from the General discussion mailing list archive at Nabble.com.

------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to