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
#5
The above mentioned things i tried as you mentioned previously in the comment.
Actually ser is define in Testing.py class where i'm selecting the serial port and baud rate and same variable i want to use in AutomationTesting.py file particularly in data function to write the data using serial port. But while compiling the script i'm getting error at that particular line in ser.write.
Error:
Exception in Tkinter callback Traceback (most recent call last): File "C:\Python27\lib\lib-tk\Tkinter.py", line 1541, in __call__ return self.func(*args) File "D:\PyCharm\Main_Project_75F\Separate_GUI_Class\AutomationTesting_ITOM.py", line 176, in clicked self.txt1.insert(END, self.data_tx()) File "D:\PyCharm\Main_Project_75F\Separate_GUI_Class\AutomationTesting_ITOM.py", line 168, in data_tx ser.write(data) AttributeError: 'str' object has no attribute 'write'
Reply


Messages In This Thread
RE: Issue while importing variable from one file to other - by mamta_parida - Aug-27-2018, 11:29 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