I'm trying to piece together some Python code to control UNIX screen processes (/usr/bin/screen) as part of a script to ease on-server deployment. Are there any libraries or modules that could facilitate this? Is there a better way to do this than just using a standard Python subprocess?
-
I'm not sure what you're exactly looking for, but you might want to take a look at byobu source code as an example about how to enhance screen.jcollado– jcollado2011-11-29 17:48:43 +00:00Commented Nov 29, 2011 at 17:48
-
I was wondering if there was some nice API -- ideally in Python -- out there to control /usr/bin/screen instead of wrapping command line commands in subprocesses.svth– svth2011-11-29 17:56:39 +00:00Commented Nov 29, 2011 at 17:56
-
1This honestly sounds like a job more suited to bash. Does it need to be python?Daenyth– Daenyth2011-11-29 20:57:29 +00:00Commented Nov 29, 2011 at 20:57
-
If I may ask, what exactly in your server deployment process requires screen?favoretti– favoretti2011-11-30 00:50:03 +00:00Commented Nov 30, 2011 at 0:50
-
We run most of our processes through screen rather than as daemons, since this makes it in many ways easier to check the status of our deployed processes and to interact with their CLI.svth– svth2011-12-03 15:30:11 +00:00Commented Dec 3, 2011 at 15:30
|
Show 4 more comments
3 Answers
Do you need to use screen? Because what you need sounds just like what "fabric" (made in Python) was designed for: controlling multiple remote servers from Python scripts or interactive shell.
Here is a ink to fabric overview: http://docs.fabfile.org/en/1.3.3/index.html