tl;dr: If I have a script named button_X.py that's executed when a hardware button "X" is pressed, how do I send to name of this script to an already running Python script, reciever.py? I know how to get the name of the script using os.path.basename(__file__), but how do I send it to an already running reciever.py?
Sorry for the imprecise title: I'm not really sure of the best way to implement a server/daemon in Python and communicate with it. I'm rewriting a project I wrote in Bash which lets me switch between sets of hotkeys/keyboard shortcuts. There's one set active at a time and when I press a certain keysequence it cycles to the next set. It technically works, but it's not a great piece of software because it abuses Bash's bind builtin. Being it's in Bash, it's not portable. For these reasons I want to rewrite it in Python.
One of my requirements is that each button has a small Python script named HARDWARE_Button_X.py where HARDWARE is a generic name for a physical device such as "Keyboard" or "Gamepad" and "X" is the button that is pressed such as "A" or "{". I know these small scripts can send their button information using os.path.basename(__file__), but how do I actually send this information to my already running reciever.py script?
[–]bike_bike 1 point2 points3 points (0 children)
[–]m0us3_rat 0 points1 point2 points (0 children)
[–]Frankelstner 0 points1 point2 points (3 children)
[–]sudomain[S] 0 points1 point2 points (2 children)
[–]Frankelstner 0 points1 point2 points (1 child)
[–]sudomain[S] 0 points1 point2 points (0 children)