Oct-22-2019, 03:31 PM
(This post was last modified: Oct-22-2019, 04:32 PM by newbieAuggie2019.)
(Oct-22-2019, 02:28 PM)jquast Wrote:(Sep-22-2019, 09:07 AM)newbieAuggie2019 Wrote: I tried blessed and blessings (data further down). The author of blessings (last release: Jun 21, 2018) is also the co-author of blessed (last release: Jun 20, 2018). Blessed provides a demo program, written in some Python 2, that I managed to adapt to Python 3, but when I ran it, its output was with no formatting and with the following warning:
Error:C:\Users\User1\AppData\Local\Programs\Python\Python37\lib\site-packages\blessed\terminal.py:32: UserWarning: One or more of the modules: 'termios', 'fcntl', and 'tty' are not found on your platform 'win32'. The following methods of Terminal are dummy/no-op unless a deriving class overrides them: setraw, cbreak, kbhit, height, width warnings.warn(_MSG_NOSUPPORT)
Hello, author of blessed here. We just merged windows support this past week, into release 1.16, so if you're still willing, please give it another try. You can do make terminal applications on windows if you are still interested. Sorry for the fork/confusion of blessings vs. blessed, I just had to make the best of having difficulty getting my changes, like keyboard support, accepted upstream into blessings, so the fork "blessed" has to continue.
Thanks for taking the time to contribute to my thread and to keep improving blessed.
blessed 1.15.0
https://pypi.org/project/blessed/
Last release: Jun 20, 2018.
has changed to:
blessed 1.16.0
https://pypi.org/project/blessed/
Last released: Oct 18, 2019.
and still has issues (no formatting at all and the error message of AttributeError: 'NoneType' object has no attribute 'fileno'
on my Python 3.7.4 Shell and the error message of C:\Users\User1\AppData\Local\Programs\Python\Python37\lib\site-packages\blessed\terminal.py:222: UserWarning: Failed to setupterm(kind='cygwin'): Could not find terminal cygwin
.format(self._kind, err)).
All the best,
AFTER POSTING HERE THE SUPPOSED CO-AUTHOR OF BLESSED, I TOOK THE TIME TO TEST THE VERSION I THOUGHT HE WAS REFERRING TO:
blessed 1.16.0
https://pypi.org/project/blessed/
Last released: Oct 18, 2019.
BUT AFTER THAT, WHILE I WAS POSTING HERE TO SHARE MY CONCLUSIONS, I CHECKED THE LINK AND SAW THAT IT WAS AGAIN CHANGED:
blessed 1.16.1
https://pypi.org/project/blessed/
Last released: 20 minutes ago.
It would have been nicer to update the package, and THEN to share it on sites where it has been mentioned, and not the other way around ...
Well, after updating AGAIN the blessed package, I used this program to check its features:
# you_are_blessed_01.py # from blessed import Terminal t = Terminal() print(t.bold('Hi there!')) print(t.bold_red_on_bright_green('It hurts my eyes!')) with t.location(0, t.height - 1): print(t.center(t.blink('press any key to continue.'))) with t.cbreak(): inp = t.inkey() print('You pressed ' + repr(inp)) print('I am ' + t.bold('bold') + '!') print('All your ' + t.red('base') + t.underline(' belongs to us now!')) print('This should be ' + t.bold(t.red('bold')) + ' and red text.')producing this error on my Python 3.7.4 Shell:
Error:Traceback (most recent call last):
File "C:\Users\User1\AppData\Local\Programs\Python\Python37\you_are_blessed_01.py", line 25, in <module>
t = Terminal()
File "C:\Users\User1\AppData\Local\Programs\Python\Python37\lib\site-packages\blessed\terminal.py", line 176, in __init__
self._keyboard_fd = sys.__stdin__.fileno()
AttributeError: 'NoneType' object has no attribute 'fileno'
and no formatting at all and a user warning on Cmder:Output:D:\new downloads 28102017\cmder
λ you_are_blessed_01.py
Error:C:\Users\User1\AppData\Local\Programs\Python\Python37\lib\site-packages\blessed\terminal.py:222: UserWarning: Failed to setupterm(kind='cygwin'): Could not find terminal cygwin
.format(self._kind, err))
Hi there!
It hurts my eyes!
press any key to continue.
You pressed 'b'
I am bold!
All your base belongs to us now!
This should be bold and red text.
When I tried to run this other program:# you_are_blessed_03.py # # from blessed import Terminal term = Terminal() with term.location(0, term.height - 1): print('This is' + term.underline('underlined') + '!')the same error and warning messages appeared and no formatting both on Python 3.7.4 Shell and Cmder.
All the best,
newbieAuggie2019
"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs
"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs