Warning; this is my first venture into python & pySide.
Have the following in a python file, quota.py.
import sys
import subprocess
def get_quota():
process = subprocess.Popen(['/home/me/scripts/pySide/dummy.sh'], stdout=subprocess.PIPE)
quotaoutput = process.communicate()[0]
#print quotaoutput
txtQuota.append(quotaoutput)
I am trying to use this function to write the output of the bash script into a textwidget (txtQuota) but python tells me that txtQuota is not defined. The txtQuota widget is defined in another file, statchk.py, that was generated by designer-qt4 and pyside-uic. The function is called with a pushbutton.
self.btnQuota.clicked.connect(get_quota)
The function will work with a print statement and nicely output quotaoutput to the terminal. I’m just at a loss as to how to tell the get_quota function how to find the textwidget.
Any comments, advice, or suggestions are welcome.
Thanks in advance.
↧