[pygtk] Pygtk and Pythonw with .pyw extension

baykusderki at gmail.com baykusderki at gmail.com
Fri Mar 19 01:16:14 WST 2010


I am having a terrible time running my Pygtk app without a console. The
app runs and works fine if I run with .py extension but then I get a
console view which is fine when I use it only for myself. So I change
the extension to .pyw to disable the Python console. Well the Gui app
opens fine but then it does not do anything at all. I have some bindings
on the buttons via the dic method.

"dic = { "on_SearchNow_clicked" : self.searchNow_Clicked,
                "on_MainWindow_destroy" : gtk.main_quit,
                "on_About_clicked" : self.about_Clicked"

This and the corresponding class methods work fine when the extension is
".py". But when I run it with ".pyw"(without changing anything in the
code except the extension), the "on_SearchNow_clicked" :
self.searchNow_Clicked" connection does not produce any kind of  result
as expected. I even stripped everything out of "self.searchNow_Clicked"
and the corresponding methods and just put a simple
"self.SearchResult_Write=self.SearchResult_buffer.set_text("TEST CLICK")
" line in the printResult(self) method to see if it does any clicking.
No it does not really. For some reason I cannot figure out this on my own.

These are the basic methods that are responsible for nonfunctioning
bindings. Bear in mind that "on_About_clicked" : self.about_Clicked" in
the "dic" seems to work(brings the about box)

Basically the app goes through a folder-file list and and prints the
results in a GtkTextView area.

    def searchNow_Clicked(self,widget):
        #Empty the text buffer for clean results

    def printResult(self):#       

Please let me know if the given description is not obvious and have
time  to look through the code I can post it somewhere.


More information about the pygtk mailing list