In python 3 i imported the pySerial library so i could comunicate with my arduino uno by serial commands it worked very well in python 2.7 but in python 3 i keep running into a error it says this TypeError: unicode strings are not supported, please encode to bytes: 'allon' in python 2.7 the only thing i did diferently is use raw_input but i dont know what is happening in python 3 here is my code
import serial, time import tkinter import os def serialcmdw(): os.system('clear') serialcmd = input("serial command: ") ser.write (serialcmd) serialcmdw() ser = serial.Serial() os.system('clear') ser.port = "/dev/cu.usbmodem4321" ser.baudrate = 9600 ser.open() time.sleep(1) serialcmdw()