Advertisement
ElRandir42

Untitled

Dec 4th, 2019
401
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.11 KB | None | 0 0
  1. import asyncio
  2. import os
  3. from datetime import datetime
  4. import time
  5. from apscheduler.schedulers.asyncio import AsyncIOScheduler
  6.  
  7.  
  8. async def bla():
  9.     date_bitch = str(input('Введи время: '))
  10.     text_bitch = str(input('Введи текст: '))
  11.     print(date_bitch)
  12.     print(text_bitch)
  13.     time_now = str(time.strftime("%Y-%m-%d ", time.localtime()))
  14.     time_now += date_bitch
  15.     print(time_now)
  16.     scheduler.add_job(check, 'date', run_date=time_now, args = [text_bitch])
  17.  
  18.  
  19. async def check(*args):
  20.     print('Poshlo Poehalo')
  21.     for x in range(10):
  22.         time = str(time.strftime("%M:%S", time.localtime()))
  23.         print(f'#{x} |Чек. Текст: {text_bitch}, время сейчас: {time}.')
  24.  
  25. if __name__ == '__main__':
  26.     scheduler = AsyncIOScheduler()
  27.     #scheduler.add_job(tick, 'cron', day='*' , hour='*' , minute='*' , second='*/1')
  28.     scheduler.start()
  29.     print('Go go go Ctrl+{0} to exit'.format('Break' if os.name == 'nt' else 'C'))
  30.     try:
  31.         print('1')
  32.         asyncio.get_event_loop().run_forever()
  33.     except (KeyboardInterrupt, SystemExit):
  34.         pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement