Advertisement
Guest User

Untitled

a guest
Jul 30th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.68 KB | None | 0 0
  1. import sys
  2. from png_interface import png_maker
  3. def main():
  4.     printTitle()
  5.     inputLoop()
  6. def inputLoop():
  7.     input_var = input(" ")
  8.     parseInput(input_var)
  9. def parseInput(input_var):
  10.     if input_var   == "ls":
  11.         lsOptions()
  12.         inputLoop()
  13.     elif input_var == "1":
  14.         startOperations(1)
  15.     elif input_var == "2":
  16.         startOperations(2)
  17.     elif input_var == "3":
  18.         startOperations(3)
  19.     elif input_var == "exit":
  20.         sys.exit()
  21.     else:
  22.         print("Sorry, that is not a valid option. Enter \'ls\' for a list of options")
  23.         inputLoop()
  24. def startOperations(options):
  25.     png_setup = png_maker(options)
  26.     if png_setup.validFile==True or png_setup.validPath==True:
  27.         png_setup.setup()
  28.     else:
  29.         print("Select your option again, or press 'ls' for other options")
  30.         inputLoop()
  31. def lsOptions():
  32.     print("\n*********************************************************")
  33.     print("* To add dots to an input png image, type \t\'1\'\t*")
  34.     print("* To make a dotted png image, type \t\t\'2\'\t*")
  35.     print("* To make a varied dotted palette, type \t\'3\'\t*")
  36.     print("* To exit Dot maker, type \t\t\t\'exit\'\t*")
  37.     print("*********************************************************\n")
  38. def printTitle():
  39.     print("\n*********************************************************")
  40.     print("*\t\t Welcome to Dot Maker\t\t\t*")
  41.     print("*\t\t\t\t\t\t\t*")
  42.     print("*\t\tMade by Kevin Mendoza\t\t\t*")
  43.     print("*********************************************************")
  44.     print("*\t type \'ls\' for a list of commands\t\t*")
  45.     print("*********************************************************\n")
  46. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement