0

How can I automate task's which need a display to run , eg: ncmpcpp . I am using python to do this but the error is as follows Error opening terminal: unknown.\r. Is there any other means I can do it ? I am using a module called pexpect in python to do this. And I don't want the terminal window to open . An eg of the automation can be that, ncmpcc opens its playlist which is done by pressing 2 and then getting the result as stoud or a log file.

As I am using python to do it. I am using a module called pexpect to do it. The code is pretty simple .

import pexpect

child = pexpect.spawn("ncmpcpp")

time.sleep(2)

child.sendline("q")

print(child.read())

But when I run the error comes

MrHola21
  • 101
  • @Nmath I updated the question – MrHola21 Jul 29 '21 at 06:35
  • It is still unclear. You should provide more context. A standalone error is not very helpful. You should include the exact steps and commands that you use to reproduce this error. You should also provide more context about what you are trying to do. Give us an example with details. – Nmath Jul 29 '21 at 06:41
  • @Nmath now is it alright ? – MrHola21 Jul 29 '21 at 07:14

0 Answers0