Python Forum
Issue while importing variable from one file to other
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Issue while importing variable from one file to other
#4
the third line of this sequence is the culprit:
    def __init__(self, child):
        Tkinter.Frame.__init__(self, child)
        autotest = Testing.TestingPage()
The first error message doesn't seem to be complete. Did you post the whole error?
There should be more that explains what the issue is.
somewhere in the __init__ method of AutomationTestingPage_ITOM class you need to define ser
(self.ser = whatever)
then when referencing ser in other methods use self.ser
example in data_tx method,
def data_tx(self):
        element = [0x4D, 0x08, 0xFF, 0x06, 0x1A, 0x52]
        data = bytearray(element)
        self.ser.write(data)
        receivedata = (self.ser.read(7))
        data1 = binascii.b2a_hex(receivedata)
        data2 = ord(receivedata[6])
        return data2
Reply


Messages In This Thread
RE: Issue while importing variable from one file to other - by Larz60+ - Aug-27-2018, 11:18 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] Issue with calling a Class/Method in GUI File Fre3k 3 3,185 Mar-08-2020, 12:35 PM
Last Post: Fre3k

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020