Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Window freezes after clicking of button in python GTK3

import threading

def on_next2_clicked(self,button):
    def my_thread(obj):
        cmd = "My Command"
        proc = subprocess.Popen(cmd,shell=True, stdout=subprocess.PIPE)
        while True:
                line = proc.stdout.read(2)
                if not line:
                    break
                obj.fper = float(line)/100.0
                obj.ui.progressbar1.set_fraction(obj.fper)
        print "Done"

    threading.Thread(target=my_thread, args=(self,)).start()
Comment

PREVIOUS NEXT
Code Example
Python :: ret, img_frame = cap.read() 
Python :: python quick tutorial 
Python :: Uso de lambda 
Python :: how to create dataframe from rdd 
Python :: Proper Case django template 
Python :: How to make exit button? 
Python :: fibonacci sphere python 
Python :: create a separate dataframe with the columns 
Python :: regression avec sklearn best 
Python :: Find dataframe column values containing a certain string 
Python :: to expend hidden columns and rows 
Python :: python if not explaned 
Python :: gensim wordvector vocabulary list 
Python :: Flask - store object directly in a session [duplicate] 
Python :: python syntax error jedi 
Python :: how to shorten turtle. to t. 
Python :: delete all historical data django simple history 
Python :: get list of all document in django-elasticsearch-dsl 
Python :: python http handler iis 
Python :: i want to check my python code online 
Python :: Which function is used to write all the characters? 
Python :: Pandas automatic allignment of columns 
Python :: sorting dictionary in python 
Python :: python variable type casting 
Python :: hide model field form 
Python :: python callables 
Python :: python any( in list FOR LOOP 
Python :: flask env variable 
Python :: how to install apps in django 
Python :: check true false in python 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =