I don't know how to power off my PC while running virtualenv and Python.

Asked 2 years ago, Updated 2 years ago, 63 views

The environment is ubuntu.Working through Putty.
activate virtualenv and

source bin/activate

Run Python

python sample.py

entered.
What should I do if I want to turn off my PC while it's still running?

python linux ubuntu putty

2022-09-30 21:33

2 Answers

Run the command in the background by combining nohup with &.

$nohup python sample.py&


2022-09-30 21:33

In such cases, it is convenient to use the screen command to operate on a virtual terminal.

If you know the following commands, you can move them.

screen
Create Virtual Terminal

Ctrl+ad
Detach the screen from the current terminal.

screen-r
Resume the detached screen session.

Also, if done, stop with Ctrl+z and use disown as stated in the comment.


2022-09-30 21:33

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.