'Is it possible to draw a single pixel to command prompt in python
So i wanna create game engine with python. Running on command prompt.
I wanna know what method an draw a single pixel to command prompt.
Solution 1:[1]
The curses may help you doing so, here's a quick example drawing a diagonal of points:
import time
import curses
window = curses.initscr()
for x in range(30):
window.addch(x, x, ".")
window.refresh()
time.sleep(1)
curses.endwin()
Keep in mind that the terminal has a character resolution: you won't be able to place pixels at any places.
But you can trick by using other chars than a dot, see for example the bb demo:
apt install bb
DISPLAY= bb
(cleaning the DISPLAY variable to force it to run inside your terminal)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Julien Palard |
