import serial.tools.list_ports

ports = serial.tools.list_ports.comports()
serialInst = serial.Serial()

portList = []

for onePort in ports:
    portList.append(str(onePort))
    print(str(onePort))

val = input("enter port: COM")

for x in range(0,len(portList)):
    if portList[x].startswith("COM"+str(val)):
        portVar="COM" + str(val)
        print(portList[x])

serialInst.baudrate = 9600
serialInst.port = portVar
serialInst.open()

while True:
    if serialInst.in_waiting:
        packet = serialInst.readline()
        a = packet.decode('utf').rstrip('\n')
        print(a)
        print("xd")

330ec58594cdbbcc077b76f75b3201b7b04a17d5
<mask token>

<mask token>
for onePort in ports:
    portList.append(str(onePort))
    print(str(onePort))
<mask token>
for x in range(0, len(portList)):
    if portList[x].startswith('COM' + str(val)):
        portVar = 'COM' + str(val)
        print(portList[x])
<mask token>
serialInst.open()
while True:
    if serialInst.in_waiting:
        packet = serialInst.readline()
        a = packet.decode('utf').rstrip('\n')
        print(a)
        print('xd')

<mask token>
ports = serial.tools.list_ports.comports()
serialInst = serial.Serial()
portList = []
for onePort in ports:
    portList.append(str(onePort))
    print(str(onePort))
val = input('enter port: COM')
for x in range(0, len(portList)):
    if portList[x].startswith('COM' + str(val)):
        portVar = 'COM' + str(val)
        print(portList[x])
serialInst.baudrate = 9600
serialInst.port = portVar
serialInst.open()
while True:
    if serialInst.in_waiting:
        packet = serialInst.readline()
        a = packet.decode('utf').rstrip('\n')
        print(a)
        print('xd')

import serial.tools.list_ports
ports = serial.tools.list_ports.comports()
serialInst = serial.Serial()
portList = []
for onePort in ports:
    portList.append(str(onePort))
    print(str(onePort))
val = input('enter port: COM')
for x in range(0, len(portList)):
    if portList[x].startswith('COM' + str(val)):
        portVar = 'COM' + str(val)
        print(portList[x])
serialInst.baudrate = 9600
serialInst.port = portVar
serialInst.open()
while True:
    if serialInst.in_waiting:
        packet = serialInst.readline()
        a = packet.decode('utf').rstrip('\n')
        print(a)
        print('xd')

import serial.tools.list_ports

ports = serial.tools.list_ports.comports()
serialInst = serial.Serial()

portList = []

for onePort in ports:
    portList.append(str(onePort))
    print(str(onePort))

val = input("enter port: COM")

for x in range(0,len(portList)):
    if portList[x].startswith("COM"+str(val)):
        portVar="COM" + str(val)
        print(portList[x])

serialInst.baudrate = 9600
serialInst.port = portVar
serialInst.open()

while True:
    if serialInst.in_waiting:
        packet = serialInst.readline()
        a = packet.decode('utf').rstrip('\n')
        print(a)
        print("xd")
