I'm new to Python and trying to automate a process on my computer, but I'm having trouble. I've already written my Python script with what I want to print, but I'd like to have my own code to press enter after that. I tried "keyboard.press(Key.enter)," but my code does not run on the terminal.
Here is the code:
from pynput.keyboard import Key, Controller
keyboard = Controller()
print(''"export SPOTIPY_CLIENT_ID='123'"'')
print(''"export SPOTIPY_CLIENT_SECRET='123'"'')
keyboard.press(Key.enter)
keyboard.release(Key.enter)
#suppose to press return
print('savify "https://open.spotify.com/playlist/37i9dQZEVXbMDoHDwVN2tF?si=eac8b42e32934a6c" -q best -f mp3 -o "/Users/" -g "%artist%/%album%"')
keyboard.press(Key.enter)
keyboard.release(Key.enter)
#suppose to press return
I expected it to run my program but it just goes to the other line.
task schedulerorcrondepending on the OS you are using, I'm hoping you would do some more tasks apart from print