Important: Please read the Qt Code of Conduct -

PySide - Append to textwidget

  • Warning; this is my first venture into python & pySide.

    Have the following in a python file,

    @import sys
    import subprocess

    def get_quota():
    process = subprocess.Popen(['/home/me/scripts/pySide/'], stdout=subprocess.PIPE)
    quotaoutput = process.communicate()[0]
    #print 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,, that was generated by designer-qt4 and pyside-uic. The function is called with a pushbutton.


    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.

  • Got it working. Moved the function definition into the class created by pyside-uic. It has to take an argument, self, so I changed the call to;


    and modified the def;

    @ def get_quota(self):
    process = subprocess.Popen(['df', '-kh'], stdout=subprocess.PIPE)
    quotaoutput = process.communicate()[0]

Log in to reply