Hi, sorry, the Python code is dependent on indentation which is removed by posting the reply.
Try the following but replace all the '>' characters at the start of the line with TAB
"""
#!/usr/bin/env python
from Tkinter import *
import os,sys
master=Tk()
var = IntVar()
def set(v):
>var.set(int(v))
>os.system("setpci -s 00:02.0 F4.B=%x"%(int(v)*16))
def full():
>set(15)
def low():
>set(1)
if __name__=="__main__":
>f=Button(master,text="Full",command=full)
>f.pack(anchor=CENTER)
>var.set(15)
>w=Scale(master,from_=15,to=1,command=set,variable=var)
>w.pack()
>f=Button(master,text="low",command=low)
>f.pack(anchor=CENTER)
>q=Button(master,text="Quit",command=sys.exit)
>q.pack(anchor=CENTER)
>mainloop()
"""
I also made a prettier one using gtk as follows. I will try posting it between code tags: it looks better in preview...
Code:
#!/usr/bin/env python
from gtk import *
import os,sys
class setb(Window):
def __init__(self):
self.win = Window(WINDOW_TOPLEVEL)
self.win.set_position(WIN_POS_CENTER)
self.win.set_property("allow-grow",False)
#self.win.set_property("allow-shrink",False)
self.b = VBox(False,0)
self.l = Label("Adjust Slider to Level")
self.l.show()
self.b.add(self.l)
self.win.set_border_width(8)
self.b.set_border_width(8)
self.win.add(self.b)
self.adj = Adjustment(14.9,1,15,1)
self.adj.connect("value_changed",self.set)
self.w=HScale(self.adj)
self.b.pack_start(self.w)
self.f=Button("Full 15")
self.f.connect("clicked",self.full)
self.b.pack_start(self.f, False, False, 10)
self.f.show()
self.lo=Button("Low 1")
self.lo.connect("clicked",self.low)
self.b.pack_start(self.lo, False, False, 10)
self.lo.show()
self.q=Button("Quit")
self.q.connect("clicked",self.quit)
self.b.pack_start(self.q, False, False, 0)
self.b.show()
self.q.show()
self.w.show()
self.win.show()
self.w.set_value(15)
self.w.emit("value_changed")
def set(self, adj):
v = adj.value
os.system("setpci -s 00:02.0 F4.B=%x"%(int(v)*16))
def full(self, e):
self.w.set_value(15)
def low(self, e):
self.w.set_value(1)
def quit(self, e):
sys.exit(0)
if __name__=="__main__":
app = setb()
main()
but I will try 10.04 LTS via Update Manager and hope this resolves the problem.