Python – How to detach Screen session with a command with Python Fabric

fabricgnu-screenpython

I know about Ctrl A and D combination. What actually I am looking that I am running a long process with screen. I want to programatically come out of it as I am using Fabric to automate my activities. If I get into command screen time python3 file.py 1000 2000 5from Fabric, it does work but how do I come out of it?

Best Answer

Normally, you wouldn't detach from screen - you would not attach yourself in the first place.

From this Stack Overflow answer:

-d -m   Start screen in "detached" mode. This creates a new session but
        doesn't  attach  to  it.  This  is  useful  for  system startup
        scripts.