I have a software in which support Python for scripting, but just fire and forget scripts, is there anyway to track memory (or something like that) to make more interactive tools?, OR is it possible to track memory by some external tools, something like key-logger but more advanced?
for example…
> Run script
|
|> loop this while script is running & Wait for 'CTRL+X' to exit the loop
|
> Exit script
Yes. There are a number of ways to do this. If you are running this on Linux, you can look at the
/procdirectory for some of this information. A more generic solution might be to listen to a socket in your script, and provide an HTTP interface for querying the state of your continuously runing script. For example, when your script starts up, it can print out something like:Then when you visit this link, the socket in your script gets an HTTP requests, which it can handle by printing out whatever status information you want to get from your script.