Python like the old-time batch files.

Bengt Richter bokr at oz.net
Fri Feb 1 16:47:18 EST 2002


On Thu, 31 Jan 2002 16:34:29 -0600, "Chris Gonnerman" <chris.gonnerman at newcenturycomputers.net> wrote:

>"MDK" <mdk at mdk.com> wrote in message
>news:<a3bhcf$176195$1 at ID-98166.news.dfncis.de>...
>> I was thinking back to years ago when I wrote batch files and I was able
>to
>> make these real nice double-line borders, change the color of things, and,
>> one of my favorite things, move the cursor up, down, left, or right in
>order
>> to write text or put lines anywhere.
>>
>> In Windows when I double click on a Python.py 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?
>>
>> Thanks.
>
>The borders I'm not sure about, but my WConio module can handle the rest.
>
>    http://newcenturycomputers.net/projects/wconio.html
>
>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.
>
>Good luck.
>
Try this in your 'DOS' window:
 >>> for i in xrange(16):
 ...     for j in xrange(16):
 ...         print chr(i<<4|j),
 ...     print
 ...

I think you'll see all the typical ascii stuff,
including box/line characters.

BTW, I've had the thought that language processors should
treat all those characters as white space. That would allow
interesting readability effects in source code (at least
looking at it with appropriate font ;-).

Treating characters with double verticals as '#' (or C++ '//')
might also be interesting. You could have this as a translation
pragma for pre-processors, perhaps.

Regards,
Bengt Richter




More information about the Python-list mailing list