Hello so I have made I python script but now I want to make it into an .exe or .bat. I have tried using pyinstaller using the command:
pyinstaller --onefile Pythonscript.py
and it works but when I try to run it I get a popup message saying
Error Python Script unable to run.
I have no idea how to fix this.
And here's my script
import time
from pynput.keyboard import Key, Controller
keyboard = Controller()
time.sleep(2)
keyboard.press(Key.cmd)
keyboard.press(Key.cmd)
keyboard.press('r')
time.sleep(2)
keyboard.release('r')
keyboard.release(Key.cmd)
keyboard.release(Key.cmd)
time.sleep(2)
keyboard.type('https://www.youtube.com/watch?v=dQw4w9WgXcQ')
time.sleep(2)
keyboard.press(Key.enter)
time.sleep(2)
keyboard.release(Key.enter)