How to control screen processes using python

I am trying to compile a piece of Python code to control UNIX screen processes (/ usr / bin / screen) as part of a script to make it easier to deploy to a server. Are there any libraries or modules that could facilitate this? Is there a better way to do this than simply using the standard Python subprocess?

+6
source share
3 answers

Found a solution. There is a Python module called screenutils .

+5
source

You can use pexpect .

There is also a plug: pexpect-u

I'm not 100% sure that there are no limitations in pexpect compared to expect , but if you find any, you can always try your hand at some tcl :)

+3
source

Do you need to use a screen? Because what you need sounds just like the fact that the "fabric" (made in Python) was intended to: manage multiple remote servers from Python scripts or an interactive shell.

Here is a review of fabric ink: http://docs.fabfile.org/en/1.3.3/index.html

+3
source

Source: https://habr.com/ru/post/902674/


All Articles