Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Executing remote python script

Executing remote python script

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 2.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    fmdragon
    wrote on last edited by
    #1

    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!

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SergioDanielG
      wrote on last edited by
      #2

      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.

      www.ftatv.com.ar El foro argentino de la TV libre

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tobias.hunger
        wrote on last edited by
        #3

        How does this relate to Qt? What OS are you uploading to?

        1 Reply Last reply
        0
        • F Offline
          F Offline
          fmdragon
          wrote on last edited by
          #4

          Sorry about that, I should have given a bit more detail.

          I'm using Qt to build my client on the front end. I want to execute the Python script on a Ubuntu server from the client after I upload a file (done using QNetworkRequest to POST the data).

          1 Reply Last reply
          0
          • T Offline
            T Offline
            tobias.hunger
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            • F Offline
              F Offline
              fmdragon
              wrote on last edited by
              #6

              Thanks for the reply Tobias. I'll figure out something server side as oppose to triggering it from the client.

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved