'OSError: Failed to read 1920 because file is missing, has improper permissions, or is an unsupported or invalid format

Hello im trying a mouse project with arduino uno and python because i dont have money to buy arduino leonardo actually arduino and reading serial with python isnt got a problem i solved everything about it but i got this errorOSError: Failed to read 1920 because file is missing, has improper permissions, or is an unsupported or invalid format

i need help for this

my code is


import pyautogui 
import time
import serial

ser = serial.Serial ('COM3', baudrate = 9600)


pyautogui.FAILSAFE= False
x=0
y = 0 
p= 0

i=0

print("program 3 saniye icinde basliyacak lutfen elinizi mouseden cekiniz")
time.sleep(3)
    
p = pyautogui.size() 

x = p[0]
y = p[1]
print('-------------------')
print("x:",x)
print("y:",y)


v=0
pyautogui.moveTo(x/2,y/2)

while True:

    pyautogui.dragTo(v,0,duration=0)

    arduinoData = ser.readline()

    o = arduinoData[2:7]

    i = o.decode('utf-8')

    v=i.replace("  ","")

    print(i)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source