from threading import Thread
from time import sleep
for i in range(4):
print(type(i))
print(i)
sleep(1)
def f(i):
sleep(5)
if int(i) == 1:
print('i=',i)
elif i == 2:
print('i=',i)
elif i == 3:
print('i=', i)
return
t = Thread(target=f, args=(i,))
t.start()
t.join()
from datetime import datetime
import time
import pyglet
import os
dll_file_name = os.path.join(os.path.dirname(__file__), 'avbin')
pyglet.lib.load_library(dll_file_name)
"""
#Просто запустить mp3 файл.
song = pyglet.media.load('1.mp3')
song.play()
pyglet.app.run()
"""
hours = str(input("Enter Hours: "))
minutes = str(input("Enter Minutes: "))
timesum = hours + ':' + minutes
def play_song():
song = pyglet.media.load('1.mp3')
song.play()
pyglet.app.run()
def clock():
timenow = datetime.now().time()
timeredirect = str(timenow)
timeneed = timeredirect[0:5]
if timesum != timeneed:
time.sleep(1)
return clock()
else:
try:
play_song()
return
except Exception as exc:
print(exc)
try:
clock()
except Exception as exc:
print(exc)
input()
python-3.ru/page/into-pyqt5
Вот для начала хватит)