[Nexus] PyQt and nxs files
Osborn, Raymond
rosborn at anl.gov
Mon Apr 27 13:41:29 BST 2015
The getOpenFileName function returns a tuple containing the file name and the selected file filter. Since you only want the first value, you should change the line to
name, _ = QtGui.QFileDialog.getOpenFileName(self, 'Open file','/home')
You may want to have a look at the NeXpy application to see if it does some of what you are looking for. It uses PySide rather than PyQt, although I am hoping to make it agnostic soon. You can find more details at http://nexpy.github.io/nexpy/.
Ray
On Apr 27, 2015, at 7:28 AM, yokaichiya <fabiano.yokaichiya at helmholtz-berlin.de<mailto:fabiano.yokaichiya at helmholtz-berlin.de>> wrote:
Dear all,
I am trying to develop a GUI software that reads the nxs files. I decide
to use the PyQt in order to have a nice interface. However I am having
problems to open the nxs file:
I was trying the following commands:
fname = QtGui.QFileDialog.getOpenFileName(self, 'Open file','/home')
f=nxs.open(fname,'r')
The compilation gave me the following Error message:
ctypes.ArgumentError: argument 1: <type 'exceptions.TypeError'>: wrong type
I would appreciate some help to solve this problem to open the nxs files.
Thanks in advance
Fabiano
________________________________
Helmholtz-Zentrum Berlin für Materialien und Energie GmbH
Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V.
Aufsichtsrat: Vorsitzender Prof. Dr. Dr. h.c. mult. Joachim Treusch, stv. Vorsitzende Dr. Beatrix Vierkorn-Rudolph
Geschäftsführung: Prof. Dr. Anke Rita Kaysser-Pyzalla, Thomas Frederking
Sitz Berlin, AG Charlottenburg, 89 HRB 5583
Postadresse:
Hahn-Meitner-Platz 1
D-14109 Berlin
http://www.helmholtz-berlin.de
_______________________________________________
NeXus mailing list
NeXus at nexusformat.org
http://lists.nexusformat.org/mailman/listinfo/nexus
--
Ray Osborn, Senior Scientist
Materials Science Division
Argonne National Laboratory
Argonne, IL 60439, USA
Phone: +1 (630) 252-9011
Email: ROsborn at anl.gov<mailto:ROsborn at anl.gov>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nexusformat.org/pipermail/nexus/attachments/20150427/11b18a37/attachment.html>
More information about the NeXus
mailing list