vinothS
Posts: 12
Joined: Sat Nov 18, 2017 9:39 am

Threads for two different Python Files

Sat Nov 18, 2017 10:16 am

Dear All,

I have two python file, one is wifi communication between Raspberry Pi 3 to Alexa wifi speaker and Another one file is Bluetooth communication
between Raspberry Pi 3 to Android,
Now, I want to run both files in technical Threads we can say, I want run both in concurrently
Everyone file have infinite loop. So, How i do concurrents between the two files



Regards,
vinothS

Heater
Posts: 15949
Joined: Tue Jul 17, 2012 3:02 pm

Re: Threads for two different Python Files

Sat Nov 18, 2017 3:28 pm

Like so, using the threads library:

https://www.python-course.eu/threads.php

But are these two programs working together some how? Or they totally independent jobs.

If the latter then you can just run both of then at the same time:

$ python progA &
$ python prohB &

If you want them to stay running after you have logged out then perhaps:

$ nohup python progA &
$ nohub python prohB &

If you want them to run automatically from boot up do ask.
Memory in C++ is a leaky abstraction .

Return to “General discussion”