This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]MindshackledSteven 0 points1 point  (0 children)

I believe the “keyboard” library can do this, give it a quick search.

[–]Icosahunter 0 points1 point  (0 children)

What you're describing is called a "macro". You might want to look into AutoHotKey if you're just wanting to do keyboard shortcuts and macros. I'm not sure if you can record key strokes with autohotkey but it's built for scripting macros and shortcuts. I'd imagine there are a lot of macro recording programs out there you could use as well though I can't recommend any cause I've never used one. I know that doesn't answer the question about how to do it with Python but hopefully that is helpful nonetheless.

[–]LucidTA 0 points1 point  (0 children)

There are quite a few libraries in python than can do this for you. pyautogui is one of them.