placing text at point on console

B

bart

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
 
I

Irmen de Jong

bart said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top