python - How to bring the value of "val" to the bottom? -


the following code , want bring variable "val" bottom, how can it?

#!/usr/bin/env python  import gtk  class scalebutton: def __init__(self):     window = gtk.window()     window.set_default_size(100, 100)     scalebutton = gtk.scalebutton(gtk.icon_size_menu, float(0), float(2.5),         float(0.025), (gtk.stock_zoom_fit, gtk.stock_zoom_fit))     scalebutton.set_value(float(0.4))     val = scalebutton.get_value() 

the variable "val has printed in bottom

    window.connect("destroy", lambda w: gtk.main_quit())     scalebutton.connect("value-changed", self.value_changed)      window.add(scalebutton)     window.show_all()  def value_changed(self, scalebutton, value):      valu = scalebutton.get_value()     print valu     print val 

is there way print these 2 variables in single

scalebutton() gtk.main() 

you set variable val global. global val you'd have set @ beginning , call global everywhere wanted use value.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -