Questions tagged [asciimatics]

For questions relating to the asciimatics python package.

Asciimatics is a cross platform package to do curses-like operations, plus higher level APIs and widgets to create text UIs and ASCII art animations.

It provides a single cross-platform Python class to do all the low-level console function you could ask for, including:

  • Coloured/styled text - including 256 colour terminals and unicode characters (even CJK languages)
  • Cursor positioning
  • Keyboard input (without blocking or echoing) including unicode support
  • Mouse input (terminal permitting)
  • Detecting and handling when the console resizes
  • Screen scraping

In addition, it provides some simple, high-level APIs to provide more complex features including:

  • Anti-aliased ASCII line-drawing
  • Image to ASCII conversion - including JPEG and GIF formats
  • Many animation effects - e.g. sprites, particle systems, banners, etc.
  • Various widgets for text UIs - e.g. buttons, text boxes, radio buttons, etc.

For full details on how to use this package, check out the documentation.

12 questions
2
votes
1 answer

tmux - how to display an image in a pane?

I'd like to display an animated GIF or any other image in a pane in tmux. I'm playing with asciimatics to do this, and have modded one of the sample programs (images.py) to: display a single image show no error messages on "Ctrl+C" accept a single…
Brad Parks
  • 66,836
  • 64
  • 257
  • 336
1
vote
1 answer

RuntimeError: input(): lost sys.stdin - Directly after an asciimatic's animation

I was curious if anyone had any insight to this error I am having. I have a program in python that run's an intro-animation using asciimatics. Following this animation, I attempt to get input from the user using input(), but get the following error…
etchris
  • 33
  • 5
1
vote
1 answer

How to detect screen resize under Asciimatics

This little snippet will display the h x w in the bottom right-hand corner of the screen. from asciimatics.screen import Screen import time def print_dims(screen): (h, w) = screen.dimensions screen.print_at("%3d x %3d" % (h, w), w - 12, h -…
kfmfe04
  • 14,936
  • 14
  • 74
  • 140
1
vote
1 answer

How to run an ASCIImatics animation only one time in Python?

I'm trying to get the animation from ASCIImatics to run only one time then break into my normal code. Like an intro you could say. Is there a way to only run the animation one time then once you hit space bar it'll break the animation and go to the…
1
vote
1 answer

naming an asciimatics scene

I am trying to make a game with a fight. to do this i need to loop through a certain scene until either the player or monster has a health value of 0 or less. so i have variables set up to play the next scene (which is the same scene that i want to…
ajcodes
  • 17
  • 4
1
vote
1 answer

Combining python Curses with Asciimatics

I've made a curses programme with Python and was wondering if I could add asciimatics animations in it? I aimed to add the animations effects in one of my curses windows, but it seems like I can't change or resize the Screen which asciimatics…
saltykiam
  • 57
  • 7
1
vote
1 answer

Set default background for asciimatics

I understand that it is not possible to tell asciimatics to use the terminal's current color scheme (because asciimatics has no way of querying the terminal). But I would like at least to have some control and be able to select the color scheme…
blueFast
  • 41,341
  • 63
  • 198
  • 344
0
votes
1 answer

How can i move to the next scene with cross_hairs in python asciImatics?

Im new to using asciimatics, and im playing around with it to make a game. However, when i add a cross_hairs to a scene, it wont move to the next scene. How can i move to the next scene when i have cross_hairs?
ajcodes
  • 17
  • 4
0
votes
1 answer

how to run an animation screen before a ray-tracing maze (python asciimatics)

I'm playing around with asciimatics, however I'm new to python and don't understand asciimatics fully. I'm trying to run the ray-casting sample code after running an animation (the backstory for the game), but it just runs the ray-casting maze at…
ajcodes
  • 17
  • 4
0
votes
1 answer

python modules installed with pip not found

I searched for a lot of information but nothing helped me. So, basically every module installed in the python37\lib\site-packages is not importing. because this problem doesn't appear in PyCharm I just forgot about it and worked there, but now I…
0
votes
1 answer

Asciimatics Keyboard Input

I just started using the asciimatics library, and I want it to take keyboard input. My code thus far is: from asciimatics import * import time def demo(screen): while True: x = screen.get_event() if x: …
Macaroonman
  • 61
  • 1
  • 10
0
votes
1 answer

asciimatics - how to export to a GIF?

I'm new to asciimatics and would like to export animations I'm making to a GIF, at the command line. Note that I want to ONLY record the animation itself, not me starting some command in the terminal to record the gif as well. I've looked at the…
Brad Parks
  • 66,836
  • 64
  • 257
  • 336