Re: [Tutor] open-file GUI
Eli Brosh [EMAIL PROTECTED] wrote I need a simple GUI that can help me to open files and save file i.e. something similar to uigetfile in MATLAB. Google for easygui I think it will do what you want. Otherwise any GUI toolkit will have similar dialiogs but will require that you write a full GUI app. EasyGUI can be mixed with command line output. HTH -- Alan Gauld Author of the Learn to Program web site http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] open-file GUI
Hi! My demo is from wspython. Hello, I am starting to use Python+NumPy+SciPy+Matplotlib as a substitute to MATLAB. I need a simple GUI that can help me to open files and save file i.e. something similar to uigetfile in MATLAB. Is there a simple script that opens a window with a possibility to browse through the file system and pick an ASCII file ? After the file is spcified using the GUI, I want to read it using fromfile and similar commands. After I process the data I want a similar GUI that enables choosing the path and name for saving the results file. Are scripts of this type available ? Thanks Eli Brosh This method allows you to either display the last file name or change the fn to for an open command so it does not display the file name. Then fn assignment commented out... def setFilePath(self, type4file=): Search directory for path and file name! fn=self.filename t4f = wx.OPEN if type4file[0] in sS: t4f = wx.SAVE|wx.FD_OVERWRITE_PROMPT #fn = self.filename dlg = wx.FileDialog(self, self.filename + or Choose a file, self.dirname, fn, *.*, t4f) if dlg.ShowModal() == wx.ID_OK: self.filename = dlg.GetFilename() self.dirname = dlg.GetDirectory() dlg.Destroy() ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] open-file GUI
Go for wxPython, they have a pretty good tutorial on thier website ( wxpython.org) If you can use Python_Numpy_Scipy_Matplotlib then I can assure you that you will learn wxpython in a matter of minutes. 2008/7/4 Eli Brosh [EMAIL PROTECTED]: Hello, I am starting to use Python+NumPy+SciPy+Matplotlib as a substitute to MATLAB. I need a simple GUI that can help me to open files and save file *i.e.** something similar to uigetfile in MATLAB*. Is there a simple script that opens a window with a possibility to browse through the file system and pick an ASCII file ? After the file is spcified using the GUI, I want to read it using fromfile and similar commands. After I process the data I want a similar GUI that enables choosing the path and name for saving the results file. Are scripts of this type available ? Thanks Eli Brosh ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] open-file GUI
Hi! My demo is from wspython. Hello, I am starting to use Python+NumPy+SciPy+Matplotlib as a substitute to MATLAB. I need a simple GUI that can help me to open files and save file i.e. something similar to uigetfile in MATLAB. Is there a simple script that opens a window with a possibility to browse through the file system and pick an ASCII file ? After the file is spcified using the GUI, I want to read it using fromfile and similar commands. After I process the data I want a similar GUI that enables choosing the path and name for saving the results file. Are scripts of this type available ? Thanks Eli Brosh This method allows you to either display the last file name or change the fn to for an open command so it does not display the file name. Then fn assignment commented out... self.dirname=os.getcwd() #SEARCH FROM PRESENT DIRECTORY! self.filename= def setFilePath(self, type4file=): Search directory for path and file name! fn=self.filename t4f = wx.OPEN if type4file[0] in sS: t4f = wx.SAVE|wx.FD_OVERWRITE_PROMPT #fn = self.filename dlg = wx.FileDialog(self, self.filename + or Choose a file, self.dirname, fn, *.*, t4f) if dlg.ShowModal() == wx.ID_OK: self.filename = dlg.GetFilename() self.dirname = dlg.GetDirectory() dlg.Destroy() ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] open-file GUI
Hi! My demo is from wspython. The Hebrew window messed up my reading and now I have included the imports and the initial assignment. You can place them in caps for global vars, but place them inside a class so they are self...calls. Hello, I am starting to use Python+NumPy+SciPy+Matplotlib as a substitute to MATLAB. I need a simple GUI that can help me to open files and save file i.e. something similar to uigetfile in MATLAB. Is there a simple script that opens a window with a possibility to browse through the file system and pick an ASCII file ? After the file is spcified using the GUI, I want to read it using fromfile and similar commands. After I process the data I want a similar GUI that enables choosing the path and name for saving the results file. Are scripts of this type available ? Thanks Eli Brosh This method allows you to either display the last file name or change the fn to for an open command so it does not display the file name. Then fn assignment commented out... import wx import os dirname=os.getcwd() #SEARCH FROM PRESENT DIRECTORY! filename= def setFilePath(self, type4file=): Search directory for path and file name! fn=self.filename t4f = wx.OPEN if type4file[0] in sS: t4f = wx.SAVE|wx.FD_OVERWRITE_PROMPT #fn = self.filename dlg = wx.FileDialog(self, self.filename + or Choose a file, self.dirname, fn, *.*, t4f) if dlg.ShowModal() == wx.ID_OK: self.filename = dlg.GetFilename() self.dirname = dlg.GetDirectory() dlg.Destroy() ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] open-file GUI
Many thanks for the tutor mailing-list members for their replies, The EasyGui is just what I was looking for. Regards Eli Brosh ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor