How to change the location of the pointer in python?











up vote
4
down vote

favorite
2












I want to paint some special words while the program is getting them , actually in real-time .
so I've wrote this piece of code which do it quite good but i still have problem with changing the location of the pointer with move keys on keyboard and start typing from where i moved it .
can anyone give me a hint how to do it ?
here is the CODE :



from colorama import init
from colorama import Fore
import sys
import msvcrt
special_words = ['test' , 'foo' , 'bar', 'Ham']
my_text = ''
init( autoreset = True)
while True:
c = msvcrt.getch()
if ord(c) == ord('r'): # newline, stop
break
elif ord(c) == ord('b') :
sys.stdout.write('b')
sys.stdout.write(' ')
my_text = my_text[:-1]
#CURSOR_UP_ONE = 'x1b[1A'
#ERASE_LINE = 'x1b[2K'
#print ERASE_LINE,
elif ord(c) == 224 :
set (-1, 1)
else:
my_text += c

sys.stdout.write("r") # move to the line beginning
for j, word in enumerate(my_text.split()):
if word in special_words:
sys.stdout.write(Fore.GREEN+ word)
else:
sys.stdout.write(Fore.RESET + word)
if j != len(my_text.split())-1:
sys.stdout.write(' ')
else:
for i in range(0, len(my_text) - my_text.rfind(word) - len(word)):
sys.stdout.write(' ')
sys.stdout.flush()









share|improve this question
























  • what happens if you run random-walker.py?
    – jfs
    Dec 23 '14 at 2:05















up vote
4
down vote

favorite
2












I want to paint some special words while the program is getting them , actually in real-time .
so I've wrote this piece of code which do it quite good but i still have problem with changing the location of the pointer with move keys on keyboard and start typing from where i moved it .
can anyone give me a hint how to do it ?
here is the CODE :



from colorama import init
from colorama import Fore
import sys
import msvcrt
special_words = ['test' , 'foo' , 'bar', 'Ham']
my_text = ''
init( autoreset = True)
while True:
c = msvcrt.getch()
if ord(c) == ord('r'): # newline, stop
break
elif ord(c) == ord('b') :
sys.stdout.write('b')
sys.stdout.write(' ')
my_text = my_text[:-1]
#CURSOR_UP_ONE = 'x1b[1A'
#ERASE_LINE = 'x1b[2K'
#print ERASE_LINE,
elif ord(c) == 224 :
set (-1, 1)
else:
my_text += c

sys.stdout.write("r") # move to the line beginning
for j, word in enumerate(my_text.split()):
if word in special_words:
sys.stdout.write(Fore.GREEN+ word)
else:
sys.stdout.write(Fore.RESET + word)
if j != len(my_text.split())-1:
sys.stdout.write(' ')
else:
for i in range(0, len(my_text) - my_text.rfind(word) - len(word)):
sys.stdout.write(' ')
sys.stdout.flush()









share|improve this question
























  • what happens if you run random-walker.py?
    – jfs
    Dec 23 '14 at 2:05













up vote
4
down vote

favorite
2









up vote
4
down vote

favorite
2






2





I want to paint some special words while the program is getting them , actually in real-time .
so I've wrote this piece of code which do it quite good but i still have problem with changing the location of the pointer with move keys on keyboard and start typing from where i moved it .
can anyone give me a hint how to do it ?
here is the CODE :



from colorama import init
from colorama import Fore
import sys
import msvcrt
special_words = ['test' , 'foo' , 'bar', 'Ham']
my_text = ''
init( autoreset = True)
while True:
c = msvcrt.getch()
if ord(c) == ord('r'): # newline, stop
break
elif ord(c) == ord('b') :
sys.stdout.write('b')
sys.stdout.write(' ')
my_text = my_text[:-1]
#CURSOR_UP_ONE = 'x1b[1A'
#ERASE_LINE = 'x1b[2K'
#print ERASE_LINE,
elif ord(c) == 224 :
set (-1, 1)
else:
my_text += c

sys.stdout.write("r") # move to the line beginning
for j, word in enumerate(my_text.split()):
if word in special_words:
sys.stdout.write(Fore.GREEN+ word)
else:
sys.stdout.write(Fore.RESET + word)
if j != len(my_text.split())-1:
sys.stdout.write(' ')
else:
for i in range(0, len(my_text) - my_text.rfind(word) - len(word)):
sys.stdout.write(' ')
sys.stdout.flush()









share|improve this question















I want to paint some special words while the program is getting them , actually in real-time .
so I've wrote this piece of code which do it quite good but i still have problem with changing the location of the pointer with move keys on keyboard and start typing from where i moved it .
can anyone give me a hint how to do it ?
here is the CODE :



from colorama import init
from colorama import Fore
import sys
import msvcrt
special_words = ['test' , 'foo' , 'bar', 'Ham']
my_text = ''
init( autoreset = True)
while True:
c = msvcrt.getch()
if ord(c) == ord('r'): # newline, stop
break
elif ord(c) == ord('b') :
sys.stdout.write('b')
sys.stdout.write(' ')
my_text = my_text[:-1]
#CURSOR_UP_ONE = 'x1b[1A'
#ERASE_LINE = 'x1b[2K'
#print ERASE_LINE,
elif ord(c) == 224 :
set (-1, 1)
else:
my_text += c

sys.stdout.write("r") # move to the line beginning
for j, word in enumerate(my_text.split()):
if word in special_words:
sys.stdout.write(Fore.GREEN+ word)
else:
sys.stdout.write(Fore.RESET + word)
if j != len(my_text.split())-1:
sys.stdout.write(' ')
else:
for i in range(0, len(my_text) - my_text.rfind(word) - len(word)):
sys.stdout.write(' ')
sys.stdout.flush()






python windows pointers






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 10 '15 at 20:16









HabibKazemi

722919




722919










asked Dec 23 '14 at 0:35









Mohammad Siavashi

3871824




3871824












  • what happens if you run random-walker.py?
    – jfs
    Dec 23 '14 at 2:05


















  • what happens if you run random-walker.py?
    – jfs
    Dec 23 '14 at 2:05
















what happens if you run random-walker.py?
– jfs
Dec 23 '14 at 2:05




what happens if you run random-walker.py?
– jfs
Dec 23 '14 at 2:05












1 Answer
1






active

oldest

votes

















up vote
6
down vote



accepted










Doing it the easy way



As you already seem to be using the colorama module, the most easy and portable way to position the cursor should be to use the corresponding ANSI controlsequence (see: http://en.m.wikipedia.org/wiki/ANSI_escape_code)



The one you are looking for should be CUP – Cursor Position (CSI n ; m H)positioning the cursor in row n and column m.



The code would look like this then:



def move (y, x):
print("33[%d;%dH" % (y, x))


Suffering by doing everything by hand



The long and painful way to make things work even in a windows console, that doesn't know about the above mentioned control sequence would be to use the windows API.



Fortunately the colorama module will do this (hard) work for you, as long as you don't forget a call to colorama.init().



For didactic purposes, I left the code of the most painful approach leaving out the functionality of the colorama module, doing everything by hand.



import ctypes
from ctypes import c_long, c_wchar_p, c_ulong, c_void_p


#==== GLOBAL VARIABLES ======================

gHandle = ctypes.windll.kernel32.GetStdHandle(c_long(-11))


def move (y, x):
"""Move cursor to position indicated by x and y."""
value = x + (y << 16)
ctypes.windll.kernel32.SetConsoleCursorPosition(gHandle, c_ulong(value))


def addstr (string):
"""Write string"""
ctypes.windll.kernel32.WriteConsoleW(gHandle, c_wchar_p(string), c_ulong(len(string)), c_void_p(), None)


As already stated in the comment section this attempt still leaves you with the problem, that your application will only work in the named console, so maybe you will still want to supply a curses version too.



To detect if curses is supported or you will have to use the windows API, you might try something like this.



#==== IMPORTS =================================================================
try:
import curses
HAVE_CURSES = True
except:
HAVE_CURSES = False
pass





share|improve this answer























  • The code you've provided will only work on a Windows system. It won't run at all on any other OS.
    – duskwuff
    Dec 23 '14 at 1:48










  • OP uses colorama that is documented (at least) to support positioning ANSI codes. colorama converts ANSI escape sequences into appropriate Win32 API calls; you don't need to make it yourself. Using colorama can also make the code more portable. For simple movements, I'd try blessings instead of curses.
    – jfs
    Dec 23 '14 at 2:01






  • 1




    actually what I'm doing is for windows so it doesnt matter if its wont work on the other platforms . so what is your last advice now ? will the above code work ? or there is any better way ? thanks
    – Mohammad Siavashi
    Dec 23 '14 at 10:35












  • sorry, I didn't update the answer asap. I thought my last advice would already have been clear, agreeing with S.F.Sebastian's advice. Use the functionality of the colorama module, instead of doing anything by hand. As it is exactly the way the colorama package emulates ANSI control sequences, the code now moved to the second section of course works. Nevertheless there is a better way. The one I put at the beginning.
    – mikyra
    Dec 23 '14 at 22:01










  • thanks for the Answer , isnt it easier to use the curses library ? does it do exactly the thing i want ? in real - time ?
    – Mohammad Siavashi
    Dec 25 '14 at 23:22













Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f27612545%2fhow-to-change-the-location-of-the-pointer-in-python%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
6
down vote



accepted










Doing it the easy way



As you already seem to be using the colorama module, the most easy and portable way to position the cursor should be to use the corresponding ANSI controlsequence (see: http://en.m.wikipedia.org/wiki/ANSI_escape_code)



The one you are looking for should be CUP – Cursor Position (CSI n ; m H)positioning the cursor in row n and column m.



The code would look like this then:



def move (y, x):
print("33[%d;%dH" % (y, x))


Suffering by doing everything by hand



The long and painful way to make things work even in a windows console, that doesn't know about the above mentioned control sequence would be to use the windows API.



Fortunately the colorama module will do this (hard) work for you, as long as you don't forget a call to colorama.init().



For didactic purposes, I left the code of the most painful approach leaving out the functionality of the colorama module, doing everything by hand.



import ctypes
from ctypes import c_long, c_wchar_p, c_ulong, c_void_p


#==== GLOBAL VARIABLES ======================

gHandle = ctypes.windll.kernel32.GetStdHandle(c_long(-11))


def move (y, x):
"""Move cursor to position indicated by x and y."""
value = x + (y << 16)
ctypes.windll.kernel32.SetConsoleCursorPosition(gHandle, c_ulong(value))


def addstr (string):
"""Write string"""
ctypes.windll.kernel32.WriteConsoleW(gHandle, c_wchar_p(string), c_ulong(len(string)), c_void_p(), None)


As already stated in the comment section this attempt still leaves you with the problem, that your application will only work in the named console, so maybe you will still want to supply a curses version too.



To detect if curses is supported or you will have to use the windows API, you might try something like this.



#==== IMPORTS =================================================================
try:
import curses
HAVE_CURSES = True
except:
HAVE_CURSES = False
pass





share|improve this answer























  • The code you've provided will only work on a Windows system. It won't run at all on any other OS.
    – duskwuff
    Dec 23 '14 at 1:48










  • OP uses colorama that is documented (at least) to support positioning ANSI codes. colorama converts ANSI escape sequences into appropriate Win32 API calls; you don't need to make it yourself. Using colorama can also make the code more portable. For simple movements, I'd try blessings instead of curses.
    – jfs
    Dec 23 '14 at 2:01






  • 1




    actually what I'm doing is for windows so it doesnt matter if its wont work on the other platforms . so what is your last advice now ? will the above code work ? or there is any better way ? thanks
    – Mohammad Siavashi
    Dec 23 '14 at 10:35












  • sorry, I didn't update the answer asap. I thought my last advice would already have been clear, agreeing with S.F.Sebastian's advice. Use the functionality of the colorama module, instead of doing anything by hand. As it is exactly the way the colorama package emulates ANSI control sequences, the code now moved to the second section of course works. Nevertheless there is a better way. The one I put at the beginning.
    – mikyra
    Dec 23 '14 at 22:01










  • thanks for the Answer , isnt it easier to use the curses library ? does it do exactly the thing i want ? in real - time ?
    – Mohammad Siavashi
    Dec 25 '14 at 23:22

















up vote
6
down vote



accepted










Doing it the easy way



As you already seem to be using the colorama module, the most easy and portable way to position the cursor should be to use the corresponding ANSI controlsequence (see: http://en.m.wikipedia.org/wiki/ANSI_escape_code)



The one you are looking for should be CUP – Cursor Position (CSI n ; m H)positioning the cursor in row n and column m.



The code would look like this then:



def move (y, x):
print("33[%d;%dH" % (y, x))


Suffering by doing everything by hand



The long and painful way to make things work even in a windows console, that doesn't know about the above mentioned control sequence would be to use the windows API.



Fortunately the colorama module will do this (hard) work for you, as long as you don't forget a call to colorama.init().



For didactic purposes, I left the code of the most painful approach leaving out the functionality of the colorama module, doing everything by hand.



import ctypes
from ctypes import c_long, c_wchar_p, c_ulong, c_void_p


#==== GLOBAL VARIABLES ======================

gHandle = ctypes.windll.kernel32.GetStdHandle(c_long(-11))


def move (y, x):
"""Move cursor to position indicated by x and y."""
value = x + (y << 16)
ctypes.windll.kernel32.SetConsoleCursorPosition(gHandle, c_ulong(value))


def addstr (string):
"""Write string"""
ctypes.windll.kernel32.WriteConsoleW(gHandle, c_wchar_p(string), c_ulong(len(string)), c_void_p(), None)


As already stated in the comment section this attempt still leaves you with the problem, that your application will only work in the named console, so maybe you will still want to supply a curses version too.



To detect if curses is supported or you will have to use the windows API, you might try something like this.



#==== IMPORTS =================================================================
try:
import curses
HAVE_CURSES = True
except:
HAVE_CURSES = False
pass





share|improve this answer























  • The code you've provided will only work on a Windows system. It won't run at all on any other OS.
    – duskwuff
    Dec 23 '14 at 1:48










  • OP uses colorama that is documented (at least) to support positioning ANSI codes. colorama converts ANSI escape sequences into appropriate Win32 API calls; you don't need to make it yourself. Using colorama can also make the code more portable. For simple movements, I'd try blessings instead of curses.
    – jfs
    Dec 23 '14 at 2:01






  • 1




    actually what I'm doing is for windows so it doesnt matter if its wont work on the other platforms . so what is your last advice now ? will the above code work ? or there is any better way ? thanks
    – Mohammad Siavashi
    Dec 23 '14 at 10:35












  • sorry, I didn't update the answer asap. I thought my last advice would already have been clear, agreeing with S.F.Sebastian's advice. Use the functionality of the colorama module, instead of doing anything by hand. As it is exactly the way the colorama package emulates ANSI control sequences, the code now moved to the second section of course works. Nevertheless there is a better way. The one I put at the beginning.
    – mikyra
    Dec 23 '14 at 22:01










  • thanks for the Answer , isnt it easier to use the curses library ? does it do exactly the thing i want ? in real - time ?
    – Mohammad Siavashi
    Dec 25 '14 at 23:22















up vote
6
down vote



accepted







up vote
6
down vote



accepted






Doing it the easy way



As you already seem to be using the colorama module, the most easy and portable way to position the cursor should be to use the corresponding ANSI controlsequence (see: http://en.m.wikipedia.org/wiki/ANSI_escape_code)



The one you are looking for should be CUP – Cursor Position (CSI n ; m H)positioning the cursor in row n and column m.



The code would look like this then:



def move (y, x):
print("33[%d;%dH" % (y, x))


Suffering by doing everything by hand



The long and painful way to make things work even in a windows console, that doesn't know about the above mentioned control sequence would be to use the windows API.



Fortunately the colorama module will do this (hard) work for you, as long as you don't forget a call to colorama.init().



For didactic purposes, I left the code of the most painful approach leaving out the functionality of the colorama module, doing everything by hand.



import ctypes
from ctypes import c_long, c_wchar_p, c_ulong, c_void_p


#==== GLOBAL VARIABLES ======================

gHandle = ctypes.windll.kernel32.GetStdHandle(c_long(-11))


def move (y, x):
"""Move cursor to position indicated by x and y."""
value = x + (y << 16)
ctypes.windll.kernel32.SetConsoleCursorPosition(gHandle, c_ulong(value))


def addstr (string):
"""Write string"""
ctypes.windll.kernel32.WriteConsoleW(gHandle, c_wchar_p(string), c_ulong(len(string)), c_void_p(), None)


As already stated in the comment section this attempt still leaves you with the problem, that your application will only work in the named console, so maybe you will still want to supply a curses version too.



To detect if curses is supported or you will have to use the windows API, you might try something like this.



#==== IMPORTS =================================================================
try:
import curses
HAVE_CURSES = True
except:
HAVE_CURSES = False
pass





share|improve this answer














Doing it the easy way



As you already seem to be using the colorama module, the most easy and portable way to position the cursor should be to use the corresponding ANSI controlsequence (see: http://en.m.wikipedia.org/wiki/ANSI_escape_code)



The one you are looking for should be CUP – Cursor Position (CSI n ; m H)positioning the cursor in row n and column m.



The code would look like this then:



def move (y, x):
print("33[%d;%dH" % (y, x))


Suffering by doing everything by hand



The long and painful way to make things work even in a windows console, that doesn't know about the above mentioned control sequence would be to use the windows API.



Fortunately the colorama module will do this (hard) work for you, as long as you don't forget a call to colorama.init().



For didactic purposes, I left the code of the most painful approach leaving out the functionality of the colorama module, doing everything by hand.



import ctypes
from ctypes import c_long, c_wchar_p, c_ulong, c_void_p


#==== GLOBAL VARIABLES ======================

gHandle = ctypes.windll.kernel32.GetStdHandle(c_long(-11))


def move (y, x):
"""Move cursor to position indicated by x and y."""
value = x + (y << 16)
ctypes.windll.kernel32.SetConsoleCursorPosition(gHandle, c_ulong(value))


def addstr (string):
"""Write string"""
ctypes.windll.kernel32.WriteConsoleW(gHandle, c_wchar_p(string), c_ulong(len(string)), c_void_p(), None)


As already stated in the comment section this attempt still leaves you with the problem, that your application will only work in the named console, so maybe you will still want to supply a curses version too.



To detect if curses is supported or you will have to use the windows API, you might try something like this.



#==== IMPORTS =================================================================
try:
import curses
HAVE_CURSES = True
except:
HAVE_CURSES = False
pass






share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 11 at 22:32









Gringo Suave

17.5k56259




17.5k56259










answered Dec 23 '14 at 1:41









mikyra

7,1882637




7,1882637












  • The code you've provided will only work on a Windows system. It won't run at all on any other OS.
    – duskwuff
    Dec 23 '14 at 1:48










  • OP uses colorama that is documented (at least) to support positioning ANSI codes. colorama converts ANSI escape sequences into appropriate Win32 API calls; you don't need to make it yourself. Using colorama can also make the code more portable. For simple movements, I'd try blessings instead of curses.
    – jfs
    Dec 23 '14 at 2:01






  • 1




    actually what I'm doing is for windows so it doesnt matter if its wont work on the other platforms . so what is your last advice now ? will the above code work ? or there is any better way ? thanks
    – Mohammad Siavashi
    Dec 23 '14 at 10:35












  • sorry, I didn't update the answer asap. I thought my last advice would already have been clear, agreeing with S.F.Sebastian's advice. Use the functionality of the colorama module, instead of doing anything by hand. As it is exactly the way the colorama package emulates ANSI control sequences, the code now moved to the second section of course works. Nevertheless there is a better way. The one I put at the beginning.
    – mikyra
    Dec 23 '14 at 22:01










  • thanks for the Answer , isnt it easier to use the curses library ? does it do exactly the thing i want ? in real - time ?
    – Mohammad Siavashi
    Dec 25 '14 at 23:22




















  • The code you've provided will only work on a Windows system. It won't run at all on any other OS.
    – duskwuff
    Dec 23 '14 at 1:48










  • OP uses colorama that is documented (at least) to support positioning ANSI codes. colorama converts ANSI escape sequences into appropriate Win32 API calls; you don't need to make it yourself. Using colorama can also make the code more portable. For simple movements, I'd try blessings instead of curses.
    – jfs
    Dec 23 '14 at 2:01






  • 1




    actually what I'm doing is for windows so it doesnt matter if its wont work on the other platforms . so what is your last advice now ? will the above code work ? or there is any better way ? thanks
    – Mohammad Siavashi
    Dec 23 '14 at 10:35












  • sorry, I didn't update the answer asap. I thought my last advice would already have been clear, agreeing with S.F.Sebastian's advice. Use the functionality of the colorama module, instead of doing anything by hand. As it is exactly the way the colorama package emulates ANSI control sequences, the code now moved to the second section of course works. Nevertheless there is a better way. The one I put at the beginning.
    – mikyra
    Dec 23 '14 at 22:01










  • thanks for the Answer , isnt it easier to use the curses library ? does it do exactly the thing i want ? in real - time ?
    – Mohammad Siavashi
    Dec 25 '14 at 23:22


















The code you've provided will only work on a Windows system. It won't run at all on any other OS.
– duskwuff
Dec 23 '14 at 1:48




The code you've provided will only work on a Windows system. It won't run at all on any other OS.
– duskwuff
Dec 23 '14 at 1:48












OP uses colorama that is documented (at least) to support positioning ANSI codes. colorama converts ANSI escape sequences into appropriate Win32 API calls; you don't need to make it yourself. Using colorama can also make the code more portable. For simple movements, I'd try blessings instead of curses.
– jfs
Dec 23 '14 at 2:01




OP uses colorama that is documented (at least) to support positioning ANSI codes. colorama converts ANSI escape sequences into appropriate Win32 API calls; you don't need to make it yourself. Using colorama can also make the code more portable. For simple movements, I'd try blessings instead of curses.
– jfs
Dec 23 '14 at 2:01




1




1




actually what I'm doing is for windows so it doesnt matter if its wont work on the other platforms . so what is your last advice now ? will the above code work ? or there is any better way ? thanks
– Mohammad Siavashi
Dec 23 '14 at 10:35






actually what I'm doing is for windows so it doesnt matter if its wont work on the other platforms . so what is your last advice now ? will the above code work ? or there is any better way ? thanks
– Mohammad Siavashi
Dec 23 '14 at 10:35














sorry, I didn't update the answer asap. I thought my last advice would already have been clear, agreeing with S.F.Sebastian's advice. Use the functionality of the colorama module, instead of doing anything by hand. As it is exactly the way the colorama package emulates ANSI control sequences, the code now moved to the second section of course works. Nevertheless there is a better way. The one I put at the beginning.
– mikyra
Dec 23 '14 at 22:01




sorry, I didn't update the answer asap. I thought my last advice would already have been clear, agreeing with S.F.Sebastian's advice. Use the functionality of the colorama module, instead of doing anything by hand. As it is exactly the way the colorama package emulates ANSI control sequences, the code now moved to the second section of course works. Nevertheless there is a better way. The one I put at the beginning.
– mikyra
Dec 23 '14 at 22:01












thanks for the Answer , isnt it easier to use the curses library ? does it do exactly the thing i want ? in real - time ?
– Mohammad Siavashi
Dec 25 '14 at 23:22






thanks for the Answer , isnt it easier to use the curses library ? does it do exactly the thing i want ? in real - time ?
– Mohammad Siavashi
Dec 25 '14 at 23:22




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f27612545%2fhow-to-change-the-location-of-the-pointer-in-python%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Xamarin.iOS Cant Deploy on Iphone

Glorious Revolution

Dulmage-Mendelsohn matrix decomposition in Python