Sedikit pengantar
: 5/2, 8/. (, ) , - - , β . , - , , . , python -, :
;
;
;
.
, . . β . - «».
Microsoft Teams , , , . , -, . .
pyautogui. , , , , , - . : , pyautogui , , .
:
def find_element(element):
""" """
sleep(1)
r = None
count = 100
while r is None:
count -= 1
r = pyautogui.locateOnScreen(dir_true_files + element, confidence=0.7)
print(count)
if count == 0:
print(element + ' !')
break
else:
if r != None:
print(element + ' !')
return r
else:
continue
pyautogui Β«100Β» 70% .
:
def press_key(key):
""" """
sleep(1)
pyautogui.press(key)
def write_text(text):
""" """
sleep(1)
pyautogui.write(text, interval=0.2)
def create_screenshot(screens_directory, name):
""" """
sleep(1)
im1 = pyautogui.screenshot()
screenshot = im1.save(screens_directory + name)
return screenshot
, , , β 09.00 12.00 Β« !Β», 12.00 17.00 Β« !Β», 17.00 21.00 Β« !Β». , n , β [β ?β, β β, β !β, β , β, β β] .. β .
OBS. . , ffmpeg, . Β« Β». , , OBS, pyautogui .
def active_window(title):
""" """
sleep(1)
app = Application().connect(title_re=title, backend='win32')
app.window(title_re=title).set_focus()
sleep(3)
, MS Teams , . ?
-, . @BotFather. , telebot. , , β .
MS Teams? selenium. Β«Open Microsoft TeamsΒ»:
def site_desktop(url):
chrome_options = webdriver.ChromeOptions()
driver = webdriver.Chrome(executable_path=driver_chrome, options=chrome_options)
driver.set_window_size(1920, 1080)
driver.get(url)
find_and_click('/open_team.png')
sleep(3)
driver.close()
, , ( 9.00, 10.40 ..) , βhttps://β, .
, url, :
selenium chrome driver ;
" Microsoft Teams";
MS Teams, - /. , ;
;
OBS, , ;
90 ;
, ;
OBS, , ;
. .
bot = telebot.TeleBot(bot_token)
@bot.message_handler(content_types=['text'])
def get_text_messages(message):
if message.text:
try:
bot.send_message(message.chat.id, text=' ')
txt = message.text
site_desktop(txt)
find_and_click('/disable_micro.png')
if find_element('/micro_status_on.png'):
find_and_click('/disable_micro.png')
find_and_click('/apply_study.png')
active_window('OBS')
press_key('f7')
sleep(3)
create_screenshot(dir_to_save_fail_screen, name_fail_screen)
bot.send_photo(message.chat.id, open(dir_to_save_fail_screen + name_fail_screen, 'rb'))
bot.send_message(message.chat.id, text=' , ')
# 90 == 5400
sleep(5400)
bot.send_message(message.chat.id, text=' , , ')
active_window('OBS')
press_key('f8')
sleep(3)
find_and_click('/exit.png')
bot.send_message(message.chat.id, text=' ')
except Exception as e:
bot.send_message(message.chat.id, text=' + ' + str(e))
bot.polling()
, 90 time.sleep, , , , . OBS MS Teams , . .
, - ( , ):
ZY Saya sama sekali tidak mendorong Anda untuk melewatkan pelajaran / berpasangan dengan cara ini - belajar itu ringan! Tapi, sayangnya, pendidikan Rusia sebagian terdiri dari ceramah kuno dari zaman Uni Soviet, knalpot yang ... sedikit lebih dari tidak sama sekali. Dan robot semacam itu akan memungkinkan Anda untuk setidaknya membongkar sebagian dan beralih ke sesuatu yang lebih berguna dan produktif.