hi...can somebody give me a little help here.
i get error message : 'file' object is not callable
its a program that call shell script (shell script run "fusion.deb").
here`s the code: test.py
#!/usr/bin/env python
import sys
import os
try:
import pygtk
pygtk.require("2.0")
except:
pass
try:
import gtk
import gtk.glade
except:
sys.exit(1)
class HelloWorldGTK:
def __init__(self):
#set the glade
self.gladefile="hello.glade"
self.wTree=gtk.glade.XML(self.gladefile)
#create dictionary and connect it
dic = { "on_button1_clicked" : self.button1_clicked,
"on_button2_clicked" : gtk.main_quit,
"on_checkbutton1_toggled": os.popen2("./nau")}
self.wTree.signal_autoconnect(dic)
def button1_clicked(self,widget):
os.popen2("gedit")
if __name__ == "__main__":
wine = HelloWorldGTK()
gtk.main()
the glade file : hello.glade
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
<!--Generated with glade3 3.4.2 on Fri Feb 13 01:37:08 2009 -->
<glade-interface>
<widget class="GtkWindow" id="window1">
<property name="visible">True</property>
<property name="title" translatable="yes">Hello World</property>
<signal name="destroy" handler="on_window1_destroy"/>
<child>
<widget class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<child>
<widget class="GtkButton" id="button1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="label" translatable="yes">Hello!</property>
<property name="response_id">0</property>
<signal name="clicked" handler="on_button1_clicked"/>
</widget>
</child>
<child>
<widget class="GtkCheckButton" id="checkbutton1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">checkbutton</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_checkbutton1_toggled"/>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="button2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="label" translatable="yes">Exit</property>
<property name="response_id">0</property>
<signal name="clicked" handler="on_button2_clicked"/>
</widget>
<packing>
<property name="position">2</property>
</packing>
</child>
</widget>
</child>
</widget>
</glade-interface>
shell script file:nau
#!/bin/sh
sudo dpkg -i fusion-icon_0.0.0+git20071028-2ubuntu2_all.deb
this message appear when i hit the checkbutton1 (run shell script)