Python Forum
keep running Console Application
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
keep running Console Application
#1
Hi folks,

I have a console Python program script. I upload it on Linux Host cloud.
I need to run it permanently, so I run it using putty by using the command: python /home/MyProj/Main.py

But the command stopped once I close the putty session.


What is the best approach to run a permanent script?
Reply
#2
The way i do it is i use tmux. Then run your program in that, detach from it and exit. Then reattach whn you log back in. The process will continue to run
Recommended Tutorials:
Reply
#3
(Dec-25-2018, 07:32 PM)metulburr Wrote: The way i do it is i use tmux. Then run your program in that, detach from it and exit. Then reattach whn you log back in. The process will continue to run


Many thanks, it works fine.
But what Shall I do if I need to turn the script off?

Thanks,

I killed the session using:

tmux kill-session -a
Reply
#4
(Dec-25-2018, 08:21 PM)MrJoo Wrote: But what Shall I do if I need to turn the script off?
You log in, reattach, and ctrl + C to kill
Recommended Tutorials:
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python running only in application Mawixy 2 1,122 Apr-19-2022, 11:38 AM
Last Post: Mawixy
  execute commands inside a running application mr_byte31 3 1,333 Apr-12-2022, 08:50 AM
Last Post: Larz60+
  How to send data from a python application to an external application aditya_rajiv 1 2,173 Jul-26-2021, 06:00 AM
Last Post: ndc85430
  Keep Application running after Python script ends PEGylated_User 0 1,974 Nov-12-2020, 03:27 PM
Last Post: PEGylated_User
  Problem running script within console koepjo 3 9,896 Mar-26-2020, 07:11 AM
Last Post: koepjo
  Keypress when running a python app in a console on windows Stephen 6 8,984 Apr-16-2019, 12:38 PM
Last Post: Stephen
  how to clear the console when the programm is running (not manually) hello_its_me 5 5,718 Sep-30-2017, 09:14 PM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020