Module my_autopylot.scheduler39
Functions
def create_batch_file(py_file_path='', bot_name='')
-
Description
Creates .bat file for the given application / exe or even .pyw BOT developed by you. This is required in Task Scheduler.
Args
py_file_path
:str
- [description]. Defaults to "".
Returns
[status] status (bool): Whether the batch file is created or not.
def create_py_file(code='', folder_path='', file_name='', bot_name='')
-
Description
Creates .py file from the given code.
Args
code
:str
- [description]. Defaults to "".
folder_path
:str
- [description]. Defaults to "".
Returns
[status] status (bool): Whether the .py file is created or not.
def schedule_code(code, bot_name, weekly_or_daily, week_day, start_time_hh_mm_24_hr_frmt)
-
Description
Schedules the given python code using Windows Task Scheduler.
Args
code
:str
- [description].
bot_name
:str
- [description].
weekly_or_daily
:str
- [description].
week_day
:str
- [description].
start_time_hh_mm_24_hr_frmt
:str
- [description].
Returns
[bool]
- [status].
def schedule_create_task_windows(batch_file_path='', bot_name='', weekly_or_daily='D', week_day='Sun', start_time_hh_mm_24_hr_frmt='11:00')
-
Description
Schedules (weekly & daily options as of now) the current BOT (.bat) using Windows Task Scheduler. Please call create_batch_file() function before using this function to convert .pyw file to .bat
Args
batch_file_path
:str
- [description]. Defaults to "".
bot_name
:str
- [description]. Defaults to "".
weekly_or_daily
:str
- [description]. Defaults to "D".
week_day
:str
- [description]. Defaults to "Sun".
start_time_hh_mm_24_hr_frmt
:str
- [description]. Defaults to "11:00".
Returns
Status (bool): Whether the task is scheduled or not.
def schedule_delete_task(bot_name='')
-
Description
Deletes already scheduled task. Asks user to supply task_name used during scheduling the task. You can also perform this action from Windows Task Scheduler.
Args
bot_name
:str
- [description]. Defaults to "".
Returns
Status (bool): Whether the task is deleted or not.
def schedule_py_file(filepath, bot_name, weekly_or_daily, week_day, start_time_hh_mm_24_hr_frmt)
-
Description
Schedules the given .py file using Windows Task Scheduler.
Args
filepath
:str
- [description].
bot_name
:str
- [description].
weekly_or_daily
:str
- [description].
week_day
:str
- [description].
start_time_hh_mm_24_hr_frmt
:str
- [description].
Returns
Status (bool): Whether the task is scheduled or not.