linux - Using python subprocess.call() to launch an ncurses process -
I am trying to call ct-ng () from a SCons SConstruct script, so basically from Python .
Use the following method: crosstool-ng uses ncurses to present the user with a menu: Unfortunately when I try to get the menu I get what I get: < / P> I see arrow keys Using the cat to display scenes while using: It seems that it is possible to separate the characters who escape the order. When I call the CT-NG script in the terminal from the command line it works correctly, this happens when I subprocess.call () Things are bad Not. My environment includes: Am I seeing a known issue? Is there anything else I should do? UPDATE: Thanks Eric .. He got me 0.5 F method. I can navigate the menu now, but still leaves behind drops: > In order to run a curse program under Python, I recommend that you use it. For example here is a simple program which You can also pass the passed character, and for input and output in the interactive method Filter function. But they get a little harder. (BTW: You can send this desired code to
ret = subprocess.call (["/ mnt / build / pw_build / crosstool-ng / bin / Ct-ng menuconfig
: / mnt / build $ cat> / dev / null ^ [o ^^ ^ [OB ^ [O. O ^ [OB ^ [OD ^ [OC ^ [OY ^ [OB
vim , add some text, Avoid command mode, issue one: w command, and then interact with user ( Or to continue editing it or whatever) Then the control returns to Python:
#! / Usr / bin / env dragon import child = pexpect.spawn ("/ usr / bin / vim") child.send ('a \ n \ nIt is another test.) Child.send (' \ x1b ') Child.send (': w! Test.txt \ n') child.interact ()
ct-ng dialog / menu in your code ... this is just one thing for your terminal settings. For example, for example, a "down arrow" cursor movement ^ "[[[[[E] [bracket] [B]] under MacD X running with Termom = xterm-256color on my item. This will be 'x1b [b' as a python string].
Comments
Post a Comment