#!/usr/bin/env python # visit https://tool.lu/pyc/ for more information # Version: Python 3.9
import tkinter.messagebox as tkinter import webbrowser import os from threading import Thread from multiprocessing import Process
defwork_01(): for i inrange(10): webbrowser.open('https://www.bilibili.com/video/BV1Cx411z73B?from=search&seid=1469035168910513716')
defwork_02(): for i inrange(30): tkinter.messagebox.showerror('Giao!', 'Error!!!Giao!Giao!Giao!')
defMulti_thread(M_work): thread_list = [] for i inrange(os.cpu_count()): program = Thread(M_work, **('target',)) thread_list.append(program) program.start() for program in thread_list: program.join()
defMulti_process(M_work): thread_list = [] for i inrange(os.cpu_count()): program = Process(M_work, **('target',)) thread_list.append(program) program.start() for program in thread_list: program.join()