weewStack / Python-projects

30 stars 28 forks source link

"ser" is not defined #1

Open davidec9712 opened 2 years ago

davidec9712 commented 2 years ago

data = ser.readline() NameError: name 'ser' is not defined

shyney7 commented 5 months ago

@weewStack I have a similar issue:

Closing the window and exiting the program...
Exception in Tkinter callback
Traceback (most recent call last):
  File "c:\Users\olivei_m\Documents\Projects\PMX_GroundStation_Visualizer\Serial_Com_ctrl.py", line 45, in SerialClose
    if self.ser.is_open:
       ^^^^^^^^
AttributeError: 'SerialCtrl' object has no attribute 'ser'
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\olivei_m\AppData\Local\Programs\Python\Python312\Lib\tkinter\__init__.py", line 1962, in __call__
    return self.func(*args)
           ^^^^^^^^^^^^^^^^
  File "c:\Users\olivei_m\Documents\Projects\PMX_GroundStation_Visualizer\GUI_Master.py", line 24, in close_window
    self.serial.SerialClose()
  File "c:\Users\olivei_m\Documents\Projects\PMX_GroundStation_Visualizer\Serial_Com_ctrl.py", line 49, in SerialClose      
    self.ser.status = False
    ^^^^^^^^
AttributeError: 'SerialCtrl' object has no attribute 'ser'
weewStack commented 5 months ago

Hi Marcel,

Thank you for your email, We can have a quick call and debug it together this weekend

let me know if you do have time

Best Regards

WeeW

On Wed, Apr 17, 2024 at 4:28 PM Marcel @.***> wrote:

@weewStack https://github.com/weewStack I have a similar issue:

Closing the window and exiting the program... Exception in Tkinter callback Traceback (most recent call last): File "c:\Users\olivei_m\Documents\Projects\PMX_GroundStation_Visualizer\Serial_Com_ctrl.py", line 45, in SerialClose if self.ser.is_open: ^^^^^^^^ AttributeError: 'SerialCtrl' object has no attribute 'ser' During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\olivei_m\AppData\Local\Programs\Python\Python312\Lib\tkinter__init.py", line 1962, in call__ return self.func(*args) ^^^^^^^^^^^^^^^^ File "c:\Users\olivei_m\Documents\Projects\PMX_GroundStation_Visualizer\GUI_Master.py", line 24, in close_window self.serial.SerialClose() File "c:\Users\olivei_m\Documents\Projects\PMX_GroundStation_Visualizer\Serial_Com_ctrl.py", line 49, in SerialClose self.ser.status = False ^^^^^^^^ AttributeError: 'SerialCtrl' object has no attribute 'ser'

— Reply to this email directly, view it on GitHub https://github.com/weewStack/Python-projects/issues/1#issuecomment-2060567181, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANUN4FSFLPNQSAV52HWMEH3Y5YQBNAVCNFSM5RCEPTDKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBWGA2TMNZRHAYQ . You are receiving this because you were mentioned.Message ID: @.***>