Answer the question
In order to leave comments, you need to log in
How to run multiple functions?
I have 2 different programs. Both have 3 functions that work endlessly. Here is the code for the first one:
thread_main = threading.Thread(target=main, name="main")
thread_set_price = threading.Thread(target=set_price, name="set_price")
thread_add = threading.Thread(target=add_to_sale, name="add_to_sale")
thread_main.start()
thread_set_price.start()
thread_add.start()
thread_main.join()
thread_set_price.join()
thread_add.join()
thread_ping = threading.Thread(target=funct.ping(key), name="ping")
thread_get_items = threading.Thread(target=funct.get_items(key), name="get_items")
thread_buy = threading.Thread(target=funct.buy(key, items), name="buy")
thread_ping.start()
thread_get_items.start()
thread_buy.start()
thread_ping.join()
thread_get_items.join()
thread_buy.join()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question