placing text at point on console

Discussion in 'Python' started by bart, Jul 1, 2003.

  1. bart

    bart Guest

    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
    bart, Jul 1, 2003
    #1
    1. Advertising

  2. 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
    Irmen de Jong, Jul 1, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stu
    Replies:
    4
    Views:
    473
  2. Luigi Donatello Asero

    Placing photo and text with CSS.

    Luigi Donatello Asero, Jan 6, 2004, in forum: HTML
    Replies:
    1
    Views:
    415
    Spartanicus
    Jan 6, 2004
  3. James Smith

    Placing of Pictures next to text.

    James Smith, Aug 12, 2004, in forum: HTML
    Replies:
    2
    Views:
    4,258
    Luigi Donatello Asero
    Aug 12, 2004
  4. Jerry Manner
    Replies:
    5
    Views:
    545
    Jonathan N. Little
    Jun 9, 2005
  5. Saraswati lakki
    Replies:
    0
    Views:
    1,298
    Saraswati lakki
    Jan 6, 2012
Loading...

Share This Page