Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   placing text at point on console (http://www.velocityreviews.com/forums/t319075-placing-text-at-point-on-console.html)

bart 07-01-2003 08:08 PM

placing text at point on console
 
I'm trying to place text at a certain point on the console. But I can't
figure out any way to do this. For instance place a '@' at point 6,8.
Any hints?

(I'm trying to display a 'map'. Think nethack)

Thanks,
Bart


Irmen de Jong 07-01-2003 08:47 PM

Re: placing text at point on console
 
bart wrote:

> I'm trying to place text at a certain point on the console. But I can't
> figure out any way to do this. For instance place a '@' at point 6,8.
> Any hints?
>
> (I'm trying to display a 'map'. Think nethack)


You didn't say which system you use. This is important information
because what you want to do is not system independent.

For Unixes/Linux, try the curses module:
http://www.python.org/doc/current/li...le-curses.html

import curses
s=curses.initscr()
s.addch(6,9,'#')
s.refresh()


For Windows, try the (non-standard) WConIO module:
http://newcenturycomputers.net/projects/wconio.html

import WConio
WConio.gotoxy(6,8)
WConio.cputs('@')



--Irmen



All times are GMT. The time now is 11:37 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57