<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class="">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 </div>
<div class=""><br class="">
</div>
<div class=""> name, _ = QtGui.QFileDialog.getOpenFileName(self, 'Open file','/home')</div>
<div class=""><br class="">
</div>
<div class="">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 <a href="http://nexpy.github.io/nexpy/" class="">http://nexpy.github.io/nexpy/</a>.</div>
<div class=""><br class="">
</div>
<div class="">Ray</div>
<div class=""><br class="">
</div>
<br class="">
<div>
<blockquote type="cite" class="">
<div class="">On Apr 27, 2015, at 7:28 AM, yokaichiya <<a href="mailto:fabiano.yokaichiya@helmholtz-berlin.de" class="">fabiano.yokaichiya@helmholtz-berlin.de</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">Dear all,<br class="">
<br class="">
I am trying to develop a GUI software that reads the nxs files. I decide<br class="">
to use the PyQt in order to have a nice interface. However I am having<br class="">
problems to open the nxs file:<br class="">
I was trying the following commands:<br class="">
<br class="">
fname = QtGui.QFileDialog.getOpenFileName(self, 'Open file','/home')<br class="">
<br class="">
f=nxs.open(fname,'r')<br class="">
<br class="">
<br class="">
The compilation gave me the following Error message:<br class="">
ctypes.ArgumentError: argument 1: <type 'exceptions.TypeError'>: wrong type<br class="">
<br class="">
I would appreciate some help to solve this problem to open the nxs files.<br class="">
<br class="">
Thanks in advance<br class="">
<br class="">
Fabiano<br class="">
<br class="">
<br class="">
________________________________<br class="">
<br class="">
Helmholtz-Zentrum Berlin für Materialien und Energie GmbH<br class="">
<br class="">
Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V.<br class="">
<br class="">
Aufsichtsrat: Vorsitzender Prof. Dr. Dr. h.c. mult. Joachim Treusch, stv. Vorsitzende Dr. Beatrix Vierkorn-Rudolph<br class="">
Geschäftsführung: Prof. Dr. Anke Rita Kaysser-Pyzalla, Thomas Frederking<br class="">
<br class="">
Sitz Berlin, AG Charlottenburg, 89 HRB 5583<br class="">
<br class="">
Postadresse:<br class="">
Hahn-Meitner-Platz 1<br class="">
D-14109 Berlin<br class="">
<br class="">
<a href="http://www.helmholtz-berlin.de" class="">http://www.helmholtz-berlin.de</a><br class="">
<br class="">
_______________________________________________<br class="">
NeXus mailing list<br class="">
NeXus@nexusformat.org<br class="">
http://lists.nexusformat.org/mailman/listinfo/nexus<br class="">
</div>
</blockquote>
</div>
<br class="">
<div apple-content-edited="true" class="">-- <br class="">
Ray Osborn, Senior Scientist<br class="">
Materials Science Division<br class="">
Argonne National Laboratory<br class="">
Argonne, IL 60439, USA<br class="">
Phone: +1 (630) 252-9011<br class="">
Email: <a href="mailto:ROsborn@anl.gov" class="">ROsborn@anl.gov</a><br class="">
<br class="">
</div>
<br class="">
</body>
</html>