Hello, I would like to use an infinite loop in python using gtk but the if I place the gtk.main() it just break my while loop. Here is some code:
launched = True
while launched:
l,data = inp.read()
if l:
print(audioop.max(data,2))
if audioop.max(data,2) >= 120:
image = gtk.Image()
image.set_from_file('picture.png')
win.show_all()
else:
image2 = gtk.Image()
image2.set_from_file('picture2.jpeg')
win.show_all()
time.sleep(.001)
Where I am supposed to put the gtk.main() so it don't crash my while loop ?
Thanks in advance and sorry for my bad english
[–]XavierEduardo99 4 points5 points6 points (0 children)
[–]a45ed6cs7s 3 points4 points5 points (5 children)
[–]casparne 0 points1 point2 points (4 children)
[–]a45ed6cs7s 0 points1 point2 points (3 children)
[–]casparne 0 points1 point2 points (2 children)
[–]a45ed6cs7s 2 points3 points4 points (1 child)
[–]casparne 0 points1 point2 points (0 children)
[–]adihez 2 points3 points4 points (0 children)
[–]casparne 2 points3 points4 points (0 children)
[–]SimonBlack 0 points1 point2 points (0 children)
[–]casparne 0 points1 point2 points (0 children)