Do this:
from threading import Thread
def func1():
print('Working')
def func2():
print("Working")
if __name__ == '__main__':
Thread(target = func1).start()
Thread(target = func2).start()
More Related Contents:
- What are the differences between the threading and multiprocessing modules?
- Python: Something like `map` that works on threads [closed]
- deciding among subprocess, multiprocessing, and thread in Python?
- How to run multiple functions at the same time?
- How to use asyncio with threading in Python is Method threading.Timer
- Multiprocessing vs Threading Python [duplicate]
- How do I parallelize a simple Python loop?
- Are lists thread-safe?
- Catch a thread’s exception in the caller thread?
- Postponing functions in python
- RuntimeError: main thread is not in main loop
- Running infinite loops using threads in python
- How do you stop numpy from multithreading? [duplicate]
- How to combine python asyncio with threads?
- Same output in different workers in multiprocessing
- is python capable of running on multiple cores?
- Can you perform multi-threaded tasks within Django?
- Why is a Python I/O bound task not blocked by the GIL?
- Python Subprocess.Popen from a thread
- Most Pythonic way to kill a thread after some period of time
- How to use threading in Python?
- Running a Tkinter form in a separate thread
- Python creating a shared variable between threads
- How to start threads at the same time in Python [duplicate]
- Is a variable swap guaranteed to be atomic in python?
- Restarting a thread in Python
- Tensorflow and Multiprocessing: Passing Sessions
- How can I profile a multithread program in Python?
- How to prefetch data using a custom python function in tensorflow
- How do I run a long-running job in the background in Python