[Tutor] Config file directory (was: File like object for Windows registry)

2006-08-04 Thread K . Weinert
Hello again! Thanks a lot for the helpful hints! I was not aware that expanduser does also work on windows since I am on WinMe... My current approach is this: import platform, os.path def _detect_filepath(): op_sys= platform.system() op_rel= platform.release() if op_sys=="Windows":

[Tutor] File like object for Windows registry

2006-08-03 Thread K . Weinert
Hello! My app should run on debian and windows platforms. For storing the configuration data, I use the ConfigParser module. What I find difficult is to determine a place for my configuration file. On debian, it is simply os.path.join(os.path.expanduser("~")),"myconfig") but what am I suppose

Re: [Tutor] [Linux] open a file in any home "~" ?

2006-04-20 Thread K . Weinert
Hi, try f=file(os.path.join(os.path.expanduser("~")),"myfile"), "r") Kind regards, Karsten. -- Echte DSL-Flatrate dauerhaft für 0,- Euro*! "Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl ___ Tutor maillist - Tutor@python.org http://mail.pytho

Re: [Tutor] wxPython

2006-01-30 Thread K. Weinert
> How can I avoid that the graphics freeze. > here is another example for doing this: http://uucode.com/texts/pylongopgui/pyguiapp.html It uses Tkinter, but it should work in wxPython, too. Kind regards, Karsten. ___ Tutor maillist - Tutor@python.

Re: [Tutor] Read Excel file without COM

2005-11-29 Thread K . Weinert
Hello, you could try to access the excel file via ODBC if the only thing you need to do is reading. It worked for me when I was working with Excel 95 (no COM) and wanted to read in worksheets in python. Here are some infos on excel datasources: http://www.idude.net/excel/articles/using_excel_file_

[Tutor] Tkinter modal dialogs

2005-11-21 Thread K . Weinert
Hello tutors! My file search dialog is working now! I attach a copy of the module. It would be nice, if someone could look over it and make suggestions to improve it. There are at least two points I find not very elegant in the program: 1. The dialog is ended by raising a SystemExit exception. (I

Re: [Tutor] Tkinter mainloop

2005-11-18 Thread K. Weinert
Hello, Thanks a lot for the pointers, Kent, and the explanations, Michael! > There is an undocumented hook that lets you change this - the function > Tk.report_callback_exception() is called to actually report the error. > You can redefine this function to do what you want. Here are a couple

[Tutor] Tkinter mainloop (was Re: tkFileDialog.Directory)

2005-11-16 Thread K . Weinert
Hello Michael, hello list, thanks for the info that pmw displays exceptions. What I don't understand is >> --- snip --- >> import Tix >> >> def raise_exception(): >> print 1/0 >> >> if __name__ == '__main__': >> root = Tix.Tk() >> root.title("Exception demo") >> >> Tix.Button

Re: [Tutor] tkFileDialog.Directory

2005-11-15 Thread K . Weinert
Hello! Michael Lange <[EMAIL PROTECTED]> wrote: > I guess the tkFileDialog.Directory class isn't intended to be used directly. > Try tkFileDialog.askdirectory() instead. > If there are problems with the grab state, try passing "parent=self.top" to askdirectory(). That did it! Thanks a lot! I wou

[Tutor] tkFileDialog.Directory

2005-11-14 Thread K . Weinert
Hello! I want to learn Tkinter and try to build a small File search dialog. Tkinter is nice, but here is a problem where I am stuck: I want to allow the dialog's user to pick a directory. The widget for this is tkFileDialog.Directory. But when I start the Directory-Window, it is possible move the