此内容来自第三方平台 (Dailymotion)。如果此视频侵犯了您的版权,请使用 立即删除 工具。
Multi_threading in python.
描述
code:
import threading
import time
def function1():
for i in range(1,11):
print(i)
time.sleep(0.5)
def function2():
for i in range(ord('a'), ord('j')+1):
print(chr(i))
time.sleep(2)
thread_fun1 = threading.Thread(target = function1)
thread_fun2 = threading.Thread(target = function2)
thread_fun1.start()
thread_fun2.start()
# function1()
# function2()
import threading
import time
def function1():
for i in range(1,11):
print(i)
time.sleep(0.5)
def function2():
for i in range(ord('a'), ord('j')+1):
print(chr(i))
time.sleep(2)
thread_fun1 = threading.Thread(target = function1)
thread_fun2 = threading.Thread(target = function2)
thread_fun1.start()
thread_fun2.start()
# function1()
# function2()
相关视频
How to input data from keyboard in python | keyboard input in python | read data from keyboard | python practically | easy way of python programming | python basics | read data from user | input from user in python | input function in python
ALL IN ONE
How to input data from keyboard in python | keyboard input in python | read data from keyboard | python practically | easy way of python programming | python basics | read data from user | input from user in python | input function in python
ALL IN ONE
Try-with-resources in python || Try catch in python || Try catch block in Python || Python course || Python tutorials || Python full course
Technical programmer
Print statement in python | how to use print statement in python | how to give message in python | printing on screen | how to print output in python | different forms of print statement | print statement in python | print function in python
ALL IN ONE
Python Programming Beginner - Lecture 3 Python 2 vs Python 3 - Complete Python Bootcamp 2016
Udemy Courses
Tkinter Events || Python Course || Python Full Course || Python programming || Python Language || Programming || coding
Technical programmer