Executing remote python script
-
I have a python script on my server that I need to execute at certain times (basically whenever I upload a file, we execute this script on said file). How would I go about doing this? The file upload fine, but I have no idea where to start when it comes to executing the python script. Any help would be appreciated, thanks!
-
Some years ago I needed do something like you.
I can't remember the code, but I used os.stat() every x seconds to check modifications on directories. When stat was modified, ran a special funtion to process changed files (always new files in my case).
Hope it help. -
How does this relate to Qt? What OS are you uploading to?
-
-
I would not even try to trigger the script from the client side. Can't you make your server trigger the script in response to the upload?
If that is not possible then services like upstart (at least the newer versions) can actually monitor directories and trigger scripts whenever they change. Or you can use inotifywait to do the same without upstart.