Def Func1 (): # SOME ACTION For c in Range (10): Time.Sleep (1) PRINT ('FUNC1', C) Print ('End Func1') Def Func2 (): # Some Other Action For i in Range (5): Time.Sleep (1) PRINT ('FUNC2', I) PRINT ('END FUNC2') DEF Main (): Thread1= Threading.Thread (target= FUNC1) Thread2= Threading.Thread (target= FUNC2) thread1.start () # Time.Sleep (10) thread2.start () if __name__== '__main__': Main ()
It is necessary to suspend the Thread1 stream at the time of completing the Thread2, then resume it in the same condition. Thread1 type fluxes are somewhat, you need to suspend them all.
tried threading.lock (), but did not quite understand the principle of action of this method.
How can I implement it? Thanks in advance.
- python : django.db.utils.Operationalerror: No Such Column: main_anzeigen.rasse -nothing helps
- python : Overlaying the looped gif animation with a transparent background on video
- How to run the source with github with the parameters you need in Python code
- python : Minimize the cost of the pipeline by selection of coordinates
- python : How to customize QSLIDER in a certain way?
- python : Not sent request to the site from the server
- python : Cookies are not inserted with proxy
- python : How to find out the random value index that is defined in Head_Check
- python : How to get the desired values?
- python : Top people by rating