2

recently, our company has been using Thingsboard which has a Python API so subsequently we have been using quite a few Python scripts to manipulate data from text files and send this data into the Thingsboard platform for ingest. At the moment we are running quite a few of these file listening scripts in debug mode in VSCode. We ultimately need to deploy these Python scripts on a Windows Server 2019 machine for a production environment. My question is: What is the recommended way to host/deploy these scripts? They idealy need to be monitored to make sure they are running and send alerts if they stop running or except. Some of the scripts are single file .py scripts. Some scripts have multiple files with classes and data files. Ideally they will have there own venv. I have thought about packaging them into an .exe and creating a service for each script. I have also considered using something like dkango, (I have no exerience of django so don't know if this is suitable). I have also considered using docker for each script. What would you do?

Paul Ruddlesdin
  • 103
  • 1
  • 1
  • 8

1 Answers1

0

I don't know if it is the best way or not, but you can turn them into exe (and convert them to services), here is another stackoverflow page with different aproches for this: How can I convert a .py to .exe for Python?

docker is a nice aproche, but I don't see any good point for why using them.

About monitoring, you can eather create a visual application (where you can even change values and stuff) but not possible in services. Or simply having a log.txt file that you print stuff in.

That s what I would do, again I don't know if that s the best way of doing it.

Ren
  • 157
  • 12