AndreiL
Welcome to AndreiL.
Enjoy your time.
Please log in.

Charbox - Python

Go down

Charbox - Python

Post by Lucaci Andrei on Mon Feb 13, 2012 5:48 am

 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
'''
Created on Feb 3, 2012

@author: sin
'''
sentence = raw_input("Sentence: ")
screen_width = 80
text_width = len(sentence)
box_width = text_width + 6
left_margin = (screen_width - box_width) // 2

print
print '' * left_margin + '+' + '-' * (box_width - 2) + '+'
print '' * left_margin + '| ' + '' * text_width + ' |'
print '' * left_margin + '| ' + sentence + ' |'
print '' * left_margin + '| ' + '' * text_width + ' |'
print '' * left_margin + '+' + '-' * (box_width - 2) + '+'
print

from msvcrt import getch
while 1:
keyPressed = getch()
print keyPressed
if keyPressed == "x":
break

avatar
Lucaci Andrei
"Tata Lor"


Number of messages : 222
Points : 2266743
Reputation : 1007
Registration date : 2008-08-15
Age : 25
Location : Cluj-Napoca

View user profile http://www.andreil.wgz.ro

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum