[pythonvis] My box drawing program, finally!

  • From: "Jeffrey Turner" <jturner522@xxxxxxxxx>
  • To: <pythonvis@xxxxxxxxxxxxx>
  • Date: Sun, 18 May 2014 16:21:54 -0400

This is very simple and rudimentary, but I had fun writing it.

JDog

""" This program will draw a box according to width and height specs
provided by the user"""

print "I will now draw a box for you, with pretty plus signs for the
corners, "
print "dashes for the top and bottom, and bars for the sides."
print
width = input("How wide would you like the box to be?")
print
height = input("How high would you like the box to be?")
corner = "+"
dashes = width*"-"
indent = " "*3
bar = "|"
spaces = " "*width
print
top = bottom = indent+corner+dashes+corner
print top 
sides = indent+bar+spaces+bar
count = height
while count >= 1:
  print sides
  count = count-1
print bottom
print
print "OK, here is your", width, "by", height, "box."
print "Thank you for doing business with the marvelous JDog."


Other related posts: