I have a python script ('script #1') that runs in a Windows CMD window all day long. The script runs a pynput keyboard listener, and I use this to execute a defined function in the script via a hotkey.
Can I use this same script to add/listen for a hotkey and then launch a different virtual environment and execute a separate python file ('script #2')? Any pointers on how this could be implemented?
Or should I instead add a keyboard listener to script #2 and then dump everything except the import statements of script #2 inside a def functionName
block, and then run this second listener script in a separate CMD window? Seems kind of inefficient to do this way, especially as I'd ideally like to have a number of python scripts execute via hotkey.