Moon Moon - 1 year ago 185
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 Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download