How do i call a function inside my application from the command line while the application is already running.?
I am trying to make a .bat file that opens gui of my application, even though the application is running in the background.
How do i call a function inside my application from the command line while the application is already running.?
I am trying to make a .bat file that opens gui of my application, even though the application is running in the background.
The shell script cannot communicate directly with a running process.
The simplest and “dirty” way is to make your script polling for some file in a predefined path and execute your code if you create the file.
from os.path import exists
while True:
print("Waiting for the creation of the file.")
time.sleep(5)
if exists("path_to_file"):
run_your_code