[Tutor] Writing to the terminal?

ALAN GAULD alan.gauld at btinternet.com
Tue Dec 14 02:48:43 CET 2010


I'm no expert, but you probably need to tell Python which character set to use.


 Alan Gauld
Author of the Learn To Program website
http://www.alan-g.me.uk/



>
>From: Bill Allen <wallenpb at gmail.com>
>To: Alan Gauld <alan.gauld at btinternet.com>
>Cc: *tutor python <tutor at python.org>
>Sent: Tuesday, 14 December, 2010 1:08:05
>Subject: Re: [Tutor] Writing to the terminal?
>
>Anyone know how to get WConio.putch() to properly put out a box drawing 
>character to the screen in the while at a cmd prompt?   The code page is 437, 
>but it when I tell it to put out 188, for example, it get a 1/4 character 
>instead of the box drawing character.   
>
>
>I am using WConio.putch(188)
>
>I have it WConio through the whole 0 thru 256 range 
>import WConio
>for i in range(0,257):
>     WConio.putch(i)
>
>and get:
>
>♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ 
>!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂??????????????????
>
>?????????????? ¡¢£☼¥▌§"cª«¬-r_°±²3'µ¶·,1º»¼½_¿AAAAÄÅÆÇEÉEEIIIIDÑOOOOÖxOUUUÜY_ßàáâaäåæçèéêëìíîïdñòóôoö÷oùúûüy_ÿA
>
>
>However if at the cmd prompt, out side of Python, I give it an Alt-188 I get the 
>correct  ╝
>
>Where am I going wrong?   
>
>Thanks,
>Bill Allen
>
>
>
>
>
>On Mon, Dec 13, 2010 at 12:53 PM, Bill Allen <wallenpb at gmail.com> wrote:
>
>Alan,
>>
>>Oh wow!   I was not aware of the WConio module.   That is exactly what I have 
>>been needing!
>>
>>
>>
>>Thanks,
>>Bill Allen
>>
>>
>>
>>
>>
>>On Sun, Dec 12, 2010 at 6:49 PM, Alan Gauld <alan.gauld at btinternet.com> wrote:
>>
>>
>>>"Modulok" <modulok at gmail.com> wrote
>>>
>>>
>>>For more complex stuff, (think blue screens with little white boxes
>>>>you press spacebar to activate. Kind of like an OS installer) I would
>>>>look into the `curses` module in the standard library?
>>>>
>>
curses on Unix but its not in the std library for windows.
>>>
>>>I think there is a version you can download, and there are also
>>>libraries specifically for the PC terminal, one that I've used
>>>successfully being Wconio, based on the Borland Turbo-C
>>>console I/O package conio.h.
>>>
>>>Conio is on Sourceforge.
>>>
>>>HTH,
>>>
>>>
>>>
>>>-- 
>>>Alan Gauld
>>>Author of the Learn to Program web site
>>>http://www.alan-g.me.uk/
>>>
>>>
>>>_______________________________________________
>>>
>>>Tutor maillist  -  Tutor at python.org
>>>To unsubscribe or change subscription options:
>>>http://mail.python.org/mailman/listinfo/tutor
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20101214/a73b2488/attachment.html>


More information about the Tutor mailing list