Hi, I am trying to run 2 python processes along with each other under one python file. flask_api.py, aiogram_bot.py which I want to run under app.py:
import multiprocessing
import subprocess
PYTHON_PATH="/home/Shaxius/mysite/"
api_process = multiprocessing.Process(
target=subprocess.run,
kwargs={
'args': f'{PYTHON_PATH} flask_api.py',
'shell': True
})
bot_process = multiprocessing.Process(
target=subprocess.run,
kwargs={
'args': f'{PYTHON_PATH} aiogram_bot.py',
'shell': True
})
if __name__ == '__main__':
api_process.start()
bot_process.start()
When I run app.py it gives me error:
/bin/sh: 1: /home/Shaxius/mysite/: Permission denied
Tried this and it didn't help.
chmod +x /path/to/your.file