Python like the old-time batch files.

Peter Hansen peter at
Fri Feb 1 02:14:48 CET 2002

Chris Gonnerman wrote:
> "MDK" <mdk at> wrote:
> > In Windows when I double click on a file it runs in a DOS-like
> > box.  Is it possible in Python to make those neat double-line borders,
> > change colors, and move the cursor to the exact position you want?
> The borders I'm not sure about, but my WConio module can handle the rest.
> If anyone knows about drawing lines and boxes in a Windows Console and
> is willing to illuminate me, I'll add support to WConio for that also.

Boxes are formed from lines, and the lines are just special graphic 
characters from the IBM PC Extended ASCII Display Characters as shown 
in, for example, .

For example, the following outputs a trivial, fixed-size box at the
current location:

>>> WConio.cputs('\xDA\xC4\xC4\xC4\xBF\n\xC0\xC4\xC4\xC4\xD9')

(Yes, that looks better on in the DOS prompt... :)

I'd recommend not adding it to WConio, since it is relatively 
simple to do as needed, and is not itself sufficient for much
improvement over a basic text interface, so it would likely 
grow over time and overload WConio with mostly unused 
functionality.  A new module on top of WConio might be a better


More information about the Python-list mailing list