salt-die / batgrl Goto Github PK
View Code? Open in Web Editor NEWbadass terminal graphics library
Home Page: https://salt-die.github.io/batgrl/
License: MIT License
badass terminal graphics library
Home Page: https://salt-die.github.io/batgrl/
License: MIT License
sadly I can not even get the examples running because i fail already at installation:
I installed the latest version of cython
using popOS linux, installed with "sudo python3.10 setup.py install"
i get this error msg:
Using /usr/lib/python3.10/dist-packages/opencv_python-4.5.5.62-py3.10-linux-x86_64.egg
Finished processing dependencies for nurses-2==0.1.2
Exception ignored in atexit callback: <bound method _Cache.cache_flush of <numpy.distutils.ccompiler_opt.CCompilerOpt object at 0x7f7f5e48af50>>
Traceback (most recent call last):
File "/tmp/easy_install-o3iwbut2/numpy-1.22.0/numpy/distutils/ccompiler_opt.py", line 817, in cache_flush
File "/tmp/easy_install-o3iwbut2/numpy-1.22.0/numpy/distutils/ccompiler_opt.py", line 647, in dist_log
File "/usr/lib/python3/dist-packages/numpy/init.py", line 140, in
from . import core
File "/usr/lib/python3/dist-packages/numpy/core/init.py", line 48, in
raise ImportError(msg)
ImportError:IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
- The Python version is: Python3.10 from "/usr/bin/python3.10"
- The NumPy version is: "1.19.5"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.Original error was: No module named 'numpy.core._multiarray_umath'
Exception ignored in atexit callback: <bound method _Cache.cache_flush of <numpy.distutils.ccompiler_opt.CCompilerOpt object at 0x7f7f5e6cd4e0>>
Traceback (most recent call last):
File "/tmp/easy_install-o3iwbut2/numpy-1.22.0/numpy/distutils/ccompiler_opt.py", line 817, in cache_flush
File "/tmp/easy_install-o3iwbut2/numpy-1.22.0/numpy/distutils/ccompiler_opt.py", line 647, in dist_log
File "/usr/lib/python3/dist-packages/numpy/init.py", line 140, in
from . import core
File "/usr/lib/python3/dist-packages/numpy/core/init.py", line 48, in
raise ImportError(msg)
ImportError:IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
- The Python version is: Python3.10 from "/usr/bin/python3.10"
- The NumPy version is: "1.19.5"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.Original error was: No module named 'numpy.core._multiarray_umath'
when available
https://pypi.org/project/cwcwidth/
should offer more performance than stock wcwidth ( and i guess it could be made to work with numpy str too https://github.com/sebastinas/cwcwidth )
import importlib.util
if importlib.util.find_spec('cwcwidth'):
import cwcwidth
def wcswidth(o):
return cwcwidth.wcswidth(str(o))
def wcwidth(o):
return cwcwidth.wcwidth(str(o))
else:
from wcwidth import wcwidth, wcswidth
nb: i did not test perf but i'm willing to help if there's something real to gain in generic use of batgrl.
Hi, while testing https://pygame-web.github.io/showroom/pythongit.html?-i#src/test_nurses2.py
i noticed that cursor does not come back to repl after entering text in "textbox"
Since i included nurses_2 in an external async loop i'm not sure cursor save/restore is on me or nurses_2 ( which i think it should) or i just did things wrong test code
Hey, for the last couple of days I've been struggling to use any of the widgets You present in the library (text_widget
, text_pad
, textbox
) to just place some text. Of course, I can just use a textbox
, fill it using its textbox.text
and block its user input capabilities, but that last part concerns me the most, it makes the code kind of uglier.
Would be great if you could implement such a widget (has self.text
, but no user input), or hint me at what I'm doing wrong here...
Is there a way to update the FileChooser
's root directory/node?
I've tried setting the root_node
chooser.view.root_node = Path("other/path")
and calling
chooser.view.update_tree_layout()
But nothing seemed to do the trick
Also, Happy New Year)
I was writing a simple launcher for a game (Devil Daggers) with mods and maps support and I found a strange behavior. The app worked fine, but when I introduced args to the app class instance (Launcher(custom_path, dd_path).run()
) it started throwing the following exception:
Traceback (most recent call last):
File "/home/froloket/Code/Python/DD Launcher/main.py", line 94, in <module>
Launcher(custom_path, dd_path).run()
File "/home/froloket/.local/lib/python3.10/site-packages/nurses_2/app.py", line 135, in run
asyncio.run(self._run_async())
File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/home/froloket/.local/lib/python3.10/site-packages/nurses_2/app.py", line 153, in _run_async
with io(self.asciicast_path) as (env_in, env_out):
AttributeError: 'Launcher' object has no attribute 'asciicast_path'
I'll repeat, the problem arises once the args are added, just Launcher().run()
works (with the __init__()
changed respectively)
I took a glance at the src, but haven't noticed anything weird so far.
Paste: https://pastebin.com/9UB0Ybp1 (don't worry about the logic, it's vastly incomplete)
Thanks in advance
With the key_presses.py
file, if you hold down 2 keys at once, it prints both keys once, and then continues to print the second key pressed, and only that key. I'd expect it to maybe alternate between printing the first and second key pressed. Is this possible to implement? I'd be happy to put in a PR if you could point me in the right direction. I love this library, thanks so much for your work!
Example: I pressed and held k
, and then pressed and held l
.
Got Press: KeyPressEvent(key='k', mods=Mods(alt=False, ctrl=False, shift=False))
Got Press: KeyPressEvent(key='l', mods=Mods(alt=False, ctrl=False, shift=False))
Got Press: KeyPressEvent(key='l', mods=Mods(alt=False, ctrl=False, shift=False))
Got Press: KeyPressEvent(key='l', mods=Mods(alt=False, ctrl=False, shift=False))
...
Finally, add the ball to the game field.
ball = Ball( left_paddle, right_paddle, left_score_label, right_score_label, size=(1, 2), background_color_pair=WHITE_ON_BLUE, ) game_field.add_gadgets( left_paddle, right_paddle, divider, left_score_label, right_score_label, ) self.add_gadget(game_field)
ball is missing in the add_gadgets arguments.
I discovered your library through your visualizations for advent of code. It's really cool. I will study the code and hope to achieve my own ones soon! Thank you for sharing.
I need to increase my terminal's PPI when running the application.
I would like to show 360 columns in my sparkline without grouping. But to show all columns I need to make my font smaller.
There's some method that I can change the PPI of the application?
Is there a way to log Python exceptions that occur (more specifically NameError
s)? When they occur my app just freezes and stops responding.
Whenever I try to pipe the python
command (e.g. python FILE | tee log.txt
) or use a different way to redirect output (python FILE 2&> log.txt
, echo $(python FILE) > log.txt
, etc.) I get the following error (the same with all methods above):
Traceback (most recent call last):
File "/home/froloket/Code/Python/DD Launcher/main.py", line 32, in <module>
Launcher(custom_path, mods_path, dd_path).run() # My code
File "/home/froloket/.local/lib/python3.10/site-packages/nurses_2/app.py", line 135, in run
asyncio.run(self._run_async())
File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/home/froloket/.local/lib/python3.10/site-packages/nurses_2/app.py", line 154, in _run_async
self.root = root = _Root(
File "/home/froloket/.local/lib/python3.10/site-packages/nurses_2/widgets/_root.py", line 30, in __init__
self.size = env_out.get_size()
File "/home/froloket/.local/lib/python3.10/site-packages/nurses_2/io/output/vt100.py", line 65, in get_size
cols, rows = os.get_terminal_size()
OSError: [Errno 25] Inappropriate ioctl for device
I know this might be not a nurses_2
-specific issus and that's why I marked it as [Question], but I haven't found anything on this problem, so I can't confirm if it occurs only with nurses_2
or any async python program. Either way, I think it's too important to discard.
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.