0

again a beginners question...I got a Python 3.5 script i want to run on a windows server. I found that thread and some links like this one but stil are not clear. I got my sript on my laptop and I am importing some packages like boto3 from AWS. Now I want to execute on a windows server and also have an option to stop it. My script has a thread that is running in an infinity loop until some break conditions occur.

  • How to package my "program" so I can run it on the server right away without using pip to install all the packages I imported?

  • Should I turn my thread into a deamon?

  • How to add a start/stop automatic? I think once Python is added to the path a doubleclick can start it or u are using a bat file to call it...but how to stop it?

Can someone outline the steps I need to perform?

Community
  • 1
  • 1

1 Answers1

0

Referring to your first question, I would recommend you to look into Docker. Docker is a containerization technology that makes it easier to run your software on any OS. It also "orchestrates" the installation of your dependencies by building an image so that you don't have to it manually every time. See https://runnable.com/docker/python/dockerize-your-python-application

mvenaas
  • 11
  • 4
  • can I use docker and "traditional" infrastructure? that is on that server I got only my script running in docker and all the others run on windows? –  May 19 '17 at 11:08
  • A docker container can talk to the "outside" world, and similarly receive data. Docker can be used in most of the popular OS's, including Windows and Linux. – mvenaas May 19 '17 at 11:35
  • thanks for shareing that idea. will check that one out. Still wondering what if I want to control my program? Lets say I want ot change a parameter from green to red while script is running. can i still do so? –  May 19 '17 at 12:09
  • If you have defined events in your script you can fire these by calling them from the outside, assuming you have an interface for doing this (ex: HTTP calls). You could then send in parameters and have it do things based on the data you supply. – mvenaas May 19 '17 at 12:15