Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Inform the user of Python script progress when called from Stata do-file.

    Hello,

    Apologies if this has been answered elsewhere - I've searched (here and in other places), but to no avail.

    I have a Python script that I call from a do-file using the shell command (under Windows). The Python script works, but can take some time to complete. I would like to be able to update the user on the script's progress (something along the lines of periodically displaying a message like "XXX of YYY records processed").

    I've tried to use a Python print command in hopes that the update message would print to the blue box that appears when I use the shell command (the one with the title bar that says "C:\Windows\System32\cmd.exe"), but that does not work.

    Ideally, I'd be able to give progress updates that would allow the user to see how long the process might take, but even showing that the Python script is still running is better than nothing.

    I'd be grateful for any suggestions or solutions that anyone might be able to offer.

    Thanks,

    Chip

  • #2
    You could show a progress bar in a Tk window. See the Progressbar class and this question on Stack Overflow.

    Jean-Claude Arbaut

    Comment


    • #3
      Thank you! That worked like a charm.

      Chip

      Comment

      Working...
      X