Skip to content

python code wont run and detects and invalid decimal literal on "60403" which is part of the code automatically upon starting a new project #126636

@patrickdaneil

Description

@patrickdaneil

Bug report

Bug description:

detects "60403" as invalid decimal literal, Python 3.13.0 (tags/v3.13.0:60403a5, Oct 7 2024, 09:38:07) [MSC v.1941 64 bit (AMD64)] on win32 is already in the code when i start a new project

Full Code:

Python 3.13.0 (tags/v3.13.0:60403a5, Oct  7 2024, 09:38:07) [MSC v.1941 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> import serial
import time
import xpc 


 arduino_port = 'COM3'  # Change this to the correct port for your system
baud_rate = 9600
ser = serial.Serial(arduino_port, baud_rate)

host = "127.0.0.1"  # Localhost (X-Plane running on the same machine)
port = 49009  # Default X-Plane Connect port
xp = xpc.XPlaneConnect(host=host, port=port)


try:
     while True:
        if ser.in_waiting > 0:
          
             button_state = int(ser.readline().strip())

       
             print("Button state: ", button_state)

       
            xp.sendDREF("sim/flightmodel/controls/gear_handle", button_state)  # Example: control gear
 
             time.sleep(0.1)
 
 except KeyboardInterrupt:
     print("Exiting program.")
 finally:
     ser.close()
     xp.close()

CPython versions tested on:

3.13

Operating systems tested on:

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions