# How to monitor running Python script

**URL:** <https://forum.inductiveautomation.com/t/how-to-monitor-running-python-script/90284>\
**Category:** General Discussion\
**Tags:** scripting\
**Created:** [May 13, 2024, 3:37am UTC](https://forum.inductiveautomation.com/t/how-to-monitor-running-python-script/90284 "2024-05-13T03:37:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chaoliang](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@chaoliang](https://forum.inductiveautomation.com/u/chaoliang)\
**Post date:** [May 13, 2024, 3:37am UTC](https://forum.inductiveautomation.com/t/how-to-monitor-running-python-script/90284/1 "2024-05-13T03:37:41Z")

</div>

Currently I have python scripts running either on Ignition (majority), vsc, docker or exe file.

Most of the scripts are coded for particular purpose, it does the job once the script is done. But some of the scripts need constant monitoring. For this kind of code, I have them mostly in ignition and added either log function or mapped to ignition tags for the status monitoring.

In ignition, I need to create logger function or write to ignition tags for monitor, it works ok but time consuming. In VSC, I can use trace function or print function, but still, it's not as convenient at the PLC software monitoring functions.

Just look out to see any better ways to monitor the running python scripts, basically the script is running like a PLC code, trigger every 1 sec, there's selection logic in it that I need to have real time monitoring how the logic runs and which path it goes after the selection logic, and what the values are.

Any suggestions are appreciated.

---

<div class="post-metadata">

**Author:** ![chaoliang](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@chaoliang](https://forum.inductiveautomation.com/u/chaoliang)\
**Post date:** [June 30, 2024, 4:37am UTC](https://forum.inductiveautomation.com/t/how-to-monitor-running-python-script/90284/2 "2024-06-30T04:37:25Z")

</div>

Still looking for a solution to it.

---

<div class="post-metadata">

**Author:** ![chaoliang](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@chaoliang](https://forum.inductiveautomation.com/u/chaoliang)\
**Post date:** [June 30, 2024, 4:44am UTC](https://forum.inductiveautomation.com/t/how-to-monitor-running-python-script/90284/3 "2024-06-30T04:44:25Z")

</div>

some interesting links related:

> **[7 Ways to Look at the Values of Variables While Debugging in Visual Studio -...](https://devblogs.microsoft.com/devops/7-ways-to-look-at-the-values-of-variables-while-debugging-in-visual-studio/)**
>
> When you are running your code and something is behaving unexpectedly, how do you find out what is going wrong? When I was in school the first way I learned how to debug a wonky application was by sticking “print()” statements all over the place,

[![](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/7/3714ceee4695d14612dc9e911bf15c2cf67777f0.jpeg "Variable view in VS-Code") ](https://www.youtube.com/watch?v=gMOWFcEKkf4)
