Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fill an entire line with * characters in Python [closed]

I want to fill an entire line in the screen with * characters and stop just before break line?

Something like this

********** MENU **********

Thanks

like image 381
Marco Herrarte Avatar asked Aug 14 '13 22:08

Marco Herrarte


1 Answers

>>> print(' MENU '.center(80, '*'))
************************************* MENU *************************************

Note that 80 is not the actual width of the screen. It's just an arbitrary number I choose because it's the usual size of the console window on Windows. If you want to determine the actual screen width you can try these examples for Linux and Windows.

like image 191
Viktor Kerkez Avatar answered Sep 22 '22 13:09

Viktor Kerkez