Added miss-bone-alt.py
[Python-Scripts.git] / PyCount / pytest.py
blob2e73e651a10d057dcc4a99668da2f5b22925ab51
1 #!/usr/bin/python
3 '''
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the Revised BSD License.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 Revised BSD License for more details.
12 Copyright 2011-2013 Cool Dude 2k - http://idb.berlios.de/
13 Copyright 2011-2013 Game Maker 2k - http://intdb.sourceforge.net/
14 Copyright 2011-2013 Kazuki Przyborowski - https://github.com/KazukiPrzyborowski
16 $FileInfo: count.py - Last Update: 03/09/2014 Ver 1 - Author: cooldude2k $
17 '''
19 from __future__ import division, absolute_import, print_function;
20 import sys, os, time, datetime;
21 from datetime import datetime
23 y = 0;
24 z = 0;
25 if(len(sys.argv) >= 2):
26 x = int(sys.argv[1]);
27 if(len(sys.argv) >= 3):
28 y = int(sys.argv[2]);
29 if(len(sys.argv) >= 4):
30 z = int(sys.argv[3]);
31 if(len(sys.argv) >= 5):
32 fp = open(sys.argv[4], "w+");
33 if(len(sys.argv) <= 1):
34 print("Executing %s" % (sys.argv[0]));
35 if(len(sys.argv) == 2):
36 print("Executing %s with argument %s" % (sys.argv[0], sys.argv[1]));
37 if(len(sys.argv) == 3):
38 print("Executing %s with argument %s,%s" % (sys.argv[0], sys.argv[1], sys.argv[2]));
39 if(len(sys.argv) == 4):
40 print("Executing %s with argument %s,%s,%s" % (sys.argv[0], sys.argv[1], sys.argv[2], sys.argv[3]));
41 if(len(sys.argv) == 5):
42 print("Executing %s with argument %s,%s,%s,%s" % (sys.argv[0], sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4]));
43 fp.write("Executing %s with argument %s,%s,%s,%s" % (sys.argv[0], sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4]));
44 print("Writing output to file %s" % (sys.argv[4]));
45 fp.write("Writing output to file %s" % (sys.argv[4]));
46 if(len(sys.argv) <= 1):
47 try:
48 prex = raw_input("Please enter a number to count to: ");
49 except NameError:
50 prex = input("Please enter a number to count to: ");
51 x = int(prex);
52 if(len(sys.argv) <= 2):
53 try:
54 prey = raw_input("Please enter a number to start at: ");
55 except NameError:
56 prey = input("Please enter a number to start at: ");
57 y = int(prey);
58 if(len(sys.argv) <= 3):
59 try:
60 prez = raw_input("Please enter a number to cont by: ");
61 except NameError:
62 prez = input("Please enter a number to cont by: ");
63 z = int(prez);
64 print("You entered numbers %d,%d,%d" % (x, y, z));
65 if(len(sys.argv) >= 5):
66 fp.write("You entered numbers %d,%d,%d" % (x, y, z));
67 tstart = datetime.now();
68 if(z == 0):
69 z = 1;
70 if(x <= y):
71 while (y >= x):
72 print(str(y));
73 if(len(sys.argv) >= 5):
74 fp.write(str(y));
75 if(z > 1 or z < 0):
76 y = y - z;
77 if(z == 1):
78 y = y - 1;
79 elif(x > y):
80 while (y <= x):
81 print(str(y));
82 if(len(sys.argv) >= 5):
83 fp.write(str(y));
84 if(z > 1 or z < 0):
85 y = y + z;
86 if(z == 1):
87 y = y + 1;
88 tend = datetime.now();
89 tcheck = tend - tstart;
90 print(sys.argv[0]+" executed in "+str(tcheck)+" seconds");
91 if(len(sys.argv) >= 5):
92 fp.write(sys.argv[0]+" executed in "+str(tcheck)+" seconds\n");
93 if(len(sys.argv) >= 5):
94 fp.close();