starbeamrainbowlabs
starbeamrainbowlabs

Reputation: 6106

Cross platform way to get caret position in command prompt in python

I am new to python and am looking for a cross platform way of getting the current caret/text cursor position in the linux terminal or windows command prompt

Can anybody suggest anything?

Upvotes: 2

Views: 973

Answers (1)

Bryan Oakley
Bryan Oakley

Reputation: 386240

You're asking for a way for python to ask some other program where the cursor is. There's no way to do that, cross-platform or otherwise.

Based on your comments to this question, it sounds like you're wanting something a little different, though I could be wrong about that. If you want to create a simple ASCII GUI in a command window you can use the curses library. With it you can move the cursor around the window, query where the cursor is, etc.

Upvotes: 1

Related Questions