asweigart / bext Goto Github PK
View Code? Open in Web Editor NEWA cross-platform Python 2/3 module for colorful, text-based terminal programs.
License: Other
A cross-platform Python 2/3 module for colorful, text-based terminal programs.
License: Other
Yellow appears as white on Windows. However, this only happens when I run cmd.exe directly, and not when I run the "Command Prompt" shortcut from the Start menu. I'm not sure what the difference is.
Hi! :) First of all, thanks for the wonderful app!
I have encountered this issue: when I run a script on Windows in CMD or Windows terminal and getKey any of the arrows, the following happens: any arrow is rendered as "a". However, when I run the same code in my IDE, I get '\xe0K', '\xe0M' and so on.
As far as I can see, the problem is that when you try to get key in the native environment, you get "àK", and not "\xe0K".
Any idea how we can fix that? :)
UPD: I've just tested: the "a" that I get in the console is not real "a". Therefore, my theory about "àK" may be onto something...
UPD2: This seems to be the inherited problem of the msvcrt module :(
Here is an error message from bext module when bext.hide() is used in analogClock.py example.
File` "...Documents/python/tutorial-env/lib/python3.10/site-packages/bext/__init__.py", line 588, in hide
sys.out.write('\033[?25l')
AttributeError: module 'sys' has no attribute 'out'`
Also, if I experiment and change the 'sys.out.write...' to 'sys.stdout.write...' the next line results in the same error message
File "/home/serkank2/Documents/python/tutorial-env/lib/python3.10/site-packages/bext/__init__.py", line 589, in hide
sys.out.flush()
AttributeError: module 'sys' has no attribute 'out'
Thank you for the great resources.
Nothing is printed to the screen on Ubuntu and on Windows, it keeps printing the ImportError:
print('This program requires the bext module, which you')
print('can install by following the instructions at')
print('https://pypi.org/project/Bext/')
I tried spinning up a virtual env but same results.
Good evening, using your library I came across two errors the
1st in line 568 and 569 was about sys.out.*** I fixed it on sys.stdout.*** after that the error "the out argument was not found" disappeared
Еhe 2nd problem that I can't solve at the moment and to understand what can be done about it :
line 373, in getkey
for c in self.getcharsUnix(blocking):
AttributeError: 'GetKeyUnix' object has no attribute 'getcharsUnix'
I work on the Ubuntu operating system
in init.py, I was able to fix goto by going to line 650 and re-inserting:
elif currentPlatform == 'unix':
# macOS and Linux:
import tty, termios, select, codecs # Used by getKey()
getKey = GetKeyUnix().getkey
goto = _goto_control_code
That restored it and I was able to get the bouncing DVD logo's program from chapter 5 of your book to run then. Not sure what the right fix is, but 0.0.7 appears broken at the moment. It also fixed the example rotating_cube.py too. This is on linux with with python3.9 and bext-0.0.7.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.