placing text at point on console

Irmen de Jong irmen at -NOSPAM-REMOVETHIS-xs4all.nl
Tue Jul 1 16:47:25 EDT 2003


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/lib/module-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





More information about the Python-list mailing list