Skip to content
Advertisement

Pythonic alternative of gotoxy C code

I want to make a menu-driven program for elementary database management.

So, please provide me some idea on how to use alternative of gotoxy in python with the help of below example.

I have C code which draws a vertical & a horizontal line in the center of screen as below:

JavaScript

Is there something like gotoxy() in Python too?

Advertisement

Answer

First, there’s no such thing as gotoxy or clrscr in standard C. You’re using a platform-specific library which provides them. The solution is the same for Python: use a library. One library that supports a vast number of terminals and is part of the Python distribution is curses. See http://docs.python.org/2/library/curses.html for the documentation.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement