0001 # Copyright 2003, Grant T. Olson, see License.txt for details 0002 0003 import os 0004 0005 # 0006 # Test script to be run from the command line 0007 # running webserver.py directly from the IDE 0008 # keeps on spitting out bad text in the tracebacks 0009 # 0010 0011 while 1: 0012 print """Run webserver: 0013 0014 1) Run once 0015 2) Run twice 0016 3) Run five times 0017 4) Run ten times 0018 5) Quit 0019 0020 """ 0021 choice = raw_input("Enter Choice: ") 0022 try: 0023 choice = int(choice) 0024 except: 0025 print "Invalid selection. Try again." 0026 continue 0027 if choice == 1: 0028 output = os.popen("python webserver.py") 0029 print output.read() 0030 elif choice == 2: 0031 output = os.popen("python webserver.py 2") 0032 print output.read() 0033 elif choice == 3: 0034 output = os.popen("python webserver.py 5") 0035 print output.read() 0036 elif choice == 4: 0037 output = os.popen("python webserver.py 10") 0038 print output.read() 0039 elif choice == 5: 0040 break 0041 else: 0042 print "Invalid selection. Try again." 0043 0044 0045
Generated by PyXR 0.9.4