jquast / blessed

Blessed is an easy, practical library for making python terminal apps

Home Page:http://pypi.python.org/pypi/blessed

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pipe input to python script and later be able to read user input with inkey

MasterMedo opened this issue · comments

If I were to do cat tmp | python program.py is there a way to reset the input stream for blessed so the program becomes interactive?
Something like:

term.stdin.close()
term.stdin = os.fdopen(0)

Nevermind, found what you're using in the source. sys.__stdin__ = os.fdopen(1) does the trick.

Glad to help :) have fun