Moon Moon - 5 months ago 23
Python Question

PyQt: How to execute shell command when a button clicked?

I have a QtGui and I want to execute a command for executing bash script "source base.bash" when button clicked.

Please answer using python code.

Answer

I think this is what you need.

import os
os.system("xterm -hold -e scipt.sh")

Place this code in a function and link that function to button.