#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    6
    Rep Power
    0

    Input without enter


    i need a solution for being able to take a user input, without having to wait for the enter before carrying the input on in my code



    ииииииииииииииииииииииииииииииииииииииииииииииииии
    import ctypes
    import msvcrt

    X=0
    Y=0
    while True:

    direction = msvcrt.getch()

    if direction == 1:
    X += 50
    if direction == 2:
    X -= 50
    if direction == 3:
    Y += 50
    if direction == 4:
    Y -= 50

    ctypes.windll.user32.SetCursorPos(X,Y)

    ииииииииииииииииииииииииииииииииииииииииииииии
    this piece works as a substitute for the mouse, but it is kinda redundant if you cant use the keyes with ease
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,997
    Rep Power
    481

    curses


    click here for the curses module

    If you had an ANSI terminal in unix you could control echo and raw mode with stty command.
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo