I have a following bash script:
script.sh
#!/bin/bash
echo "Ann"
echo "Kasia"
source /home/user/anaconda3/etc/profile.d/conda.sh
conda activate my_environment
conda list
I want to run it using QtCore.QProcess. I tested the following configurations, unfortunately non of them printed results.
main.py
from PyQt5 import QtCore
process = QtCore.QProcess()
process.start("/bin/bash", ["-i", "-c", "script.sh"])
from PyQt5 import QtCore
process = QtCore.QProcess()
process.start("script.sh")
The output is 'Process finished with exit code 0'
I expect it to be something like:
Ann
Kasia
wcwidth 0.2.5 py_0
webencodings 0.5.1 py38_1
werkzeug 1.0.1 py_0
wheel 0.35.1 py_0
widgetsnbextension 3.5.1 py38_0
./script.shit works fine and prints output