Skip to content

Instantly share code, notes, and snippets.

@xslendix
Created January 18, 2018 22:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xslendix/dcdd44d7fd4d6b2713aea1c3ae022c53 to your computer and use it in GitHub Desktop.
Save xslendix/dcdd44d7fd4d6b2713aea1c3ae022c53 to your computer and use it in GitHub Desktop.
Create boxes in python! Usage: python box_gen [lenght] [height] (--help)
# -*- coding: utf-8 -*-
from time import sleep
import sys
def gen_box(lenght, height):
box = ""
i = 0
while i != height:
y = 0
l = 0
x = 0
while y != lenght:
if y == lenght-1:
box = box + "╔══╗\n"
else:
box = box + "╔══╗"
y = y + 1
while l != lenght:
if l == lenght-1:
box = box + "║ ║\n"
else:
box = box + "║ ║"
l = l + 1
while x != lenght:
if x == lenght-1:
box = box + "╚══╝\n"
else:
box = box + "╚══╝"
x = x + 1
i = i + 1
return box
xandy = []
for arg in sys.argv:
xandy.append(arg)
if "--help" in xandy:
print ("Use --help to get help with python "+xandy[0]+"\npython "+xandy[0]+" [lenght] [height]")
else:
print (gen_box(int(xandy[1]), int(xandy[2]))) #prima variabila este lungimea a doua este inaltimea!!!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment