import threading
import time
import win32com.client
def sing(num):
for i in range(num):
xlsb = win32com.client.Dispatch("Excel.Application")
#xlsb.Workbooks("样本.xls")
#xlsb.Application.Run("sheet1.开始")
time.sleep(6)
def dance(num):
for i in range(num):
print("dancing%d" % i)
time.sleep(0.5)
def main():
"""创建启动线程"""
t_sing = threading.Thread(target=sing, args=(3,))
t_dance = threading.Thread(target=dance, args=(4, ))
t_sing.start()
t_dance.start()
if __name__ == '__main__':
main()
import time
import win32com.client
def sing(num):
for i in range(num):
xlsb = win32com.client.Dispatch("Excel.Application")
#xlsb.Workbooks("样本.xls")
#xlsb.Application.Run("sheet1.开始")
time.sleep(6)
def dance(num):
for i in range(num):
print("dancing%d" % i)
time.sleep(0.5)
def main():
"""创建启动线程"""
t_sing = threading.Thread(target=sing, args=(3,))
t_dance = threading.Thread(target=dance, args=(4, ))
t_sing.start()
t_dance.start()
if __name__ == '__main__':
main()