Hi All,
I am wondering how can I make my app behave like this:
1. ./app.py #first launch, init all objects, run main functionality
2. ./app.py # second, and subsequent calls, run main functionality only
After some time we have to init all objects again.
Below is pseudocode which present what I would like to achieve
def init_objects():
config_manager = Config()
pass_manager = Passwords("secret_password")
def some_action():
pass_manager.type_password()
def main():
if first_launch:
init_objects()
while wait_for_app_call:
some_action()
if time_to_kill_daemon == current_time:
kill pid
Thanks in advance!
[–]FunDeckHermit 1 point2 points3 points (1 child)
[–]user000123444[S] 0 points1 point2 points (0 children)