[Tutor] Wondering if there is a print in location command for terminal?

Alan Gauld alan.gauld at btinternet.com
Tue Feb 10 10:02:01 CET 2015


On 10/02/15 03:48, eryksun wrote:
> On Mon, Feb 9, 2015 at 6:40 PM, Alan Gauld <alan.gauld at btinternet.com> wrote:
>
> curses for Windows (based on PDCurses):
> http://www.lfd.uci.edu/~gohlke/pythonlibs/#curses

I've tried this but several iof the functions didn't work consistently.
Of course it might just be my set up or something but I wasn't overly 
impressed.

>> There are some other library packages that emulate the
>> old DOS conio package and include x/y coordinate location,
>
> The msvcrt module wraps the conio functions kbhit, getch, getche,
> ungetch, and putch (plus the [w]ide alternatives).

msvcrt wraps the Microsoft Vis C Runtime functions which don't
include positional commands.

Conio was a DOS library developed by the compiler makers as a way to 
access the BIOS calls and has a gotoXY() and similar functions. It first 
appeared, as I recall, in Turbo Pascal but was later picked
up by the C compilers as well.
There are at least 2 libraries on PyPi that simulate conio

>> but they often require ANSI.SYS or similar to be installed.
>
> That's the old-school DOS driver. For Windows try ANSICON. It injects
> ANSI32.DLL or ANSI64.DLL to hook WriteConsole and WriteFile.

I'll need to look those up. New to me, thanks for the pointer.


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list