Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to control screen processes using python

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?

like image 737
svth Avatar asked Nov 29 '11 17:11

svth


People also ask

How do I list running processes in Windows using Python?

We would be using the WMI. Win32_Process function in order to get the list of running processes on the system. Then we called the function WMI. Win32_Process() to get the running processes, iterated through each process and stored in variable process.


2 Answers

Found the solution. There's a Python module called screenutils.

like image 191
svth Avatar answered Sep 21 '22 12:09

svth


You could use pexpect.

There is also a fork: pexpect-u

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

like image 25
Derek Litz Avatar answered Sep 21 '22 12:09

Derek Litz