Modify a command: "python.execSelectionInTerminal" to send the code to already configured python terminal rather than opening a new terminal

My workflow involves the usage of the Slurm to allocate resources to use a debugging terminal. If I use the built-in VS Code Python extension to send the code from the script using shift+enter, it launches a new terminal with a Python interpreter. Still, I want the code sent to the configured active Slurm-allocated terminal. This requested feature will make my workflow very efficient.