Advertisement
Jousway

testing script in python 0.5 by Jousway

Sep 14th, 2016
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.06 KB | None | 0 0
  1. import os
  2. import sys
  3.  
  4. def pyver3():
  5.     if sys.version_info < (2, 99):
  6.         return False
  7.     else:
  8.         return True
  9.  
  10. def inpc(inp2):
  11.     if pyver3():
  12.         return input(inp2)
  13.     else:
  14.         return raw_input(inp2)
  15.  
  16. def iswindows():
  17.     osver = os.popen("ver").read()
  18.     if osver.find("Windows") > 0:
  19.         return True
  20.     else:
  21.         return False
  22.  
  23. def clear():
  24.     if iswindows():
  25.         os.system('cls')
  26.     else:
  27.         os.system('clear')
  28.  
  29. def pause():
  30.     inpc("Press any key to continue . . .")
  31.  
  32.  
  33.  
  34. def start():
  35.     clear()
  36.     print("testing script in python 0.5 by Jousway")
  37.     print("list of functions")
  38.     print("1) Python Ver")
  39.     print("2) Input Test")
  40.     print("")
  41.     print("0) Refresh")
  42.     print("q) quit")
  43.     inp = inpc("Pick function: ")
  44.     if inp == "q":
  45.         quit()
  46.     elif inp == "0":
  47.         start()    
  48.     elif inp == "2":
  49.         ptest()
  50.     elif inp == "1":
  51.         pyver()
  52.     else:
  53.         start()
  54.        
  55. def ptest():
  56.     clear()
  57.     inp = inpc("Input: ")
  58.     if inp == "":
  59.         print("add a value moron")
  60.     else:
  61.         print("Output:", inp)
  62.     pause()
  63.     start()
  64.    
  65. def pyver():
  66.     clear()
  67.     print(sys.version)
  68.     pause()
  69.     start()
  70.  
  71. start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement