[Tutor] How to access a method defined in one class from another class (which is a thread) in Python3?

Prasad, Ramit ramit.prasad at jpmorgan.com.dmarc.invalid
Thu Aug 8 22:41:41 CEST 2013


Please post responses in-line or at the bottom for this 
mailing list.

SM wrote:
> 
> Ramit:
> Thanks for the quick response. You are right about the error. When I did the following:
> x = Ui_MainWindow()
> x.setStdoutToTextEditWindowFw()
> I got the following error:
> AttributeError: 'Ui_MainWindow' object has no attribute 'textEdit_fwcmdlineoutput'
> But I do have code that creates an attribute in Ui_MainWindow() class:
> 
> self.textEdit_fwcmdlineoutput = QtGui.QTextEdit(self.tab_fw)
> This is what is making me get confused as to why it complains that there is no attribute.
> Thanks,
> -SM

You need to call that line of code to create the widget. Obviously 
it is not being created from the class's __init__. 


~Ramit



This email is confidential and subject to important disclaimers and conditions including on offers for the purchase or sale of securities, accuracy and completeness of information, viruses, confidentiality, legal privilege, and legal entity disclaimers, available at http://www.jpmorgan.com/pages/disclosures/email.  


More information about the Tutor mailing list