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 $
19 from __future__
import division
, absolute_import
, print_function
;
20 import sys
, os
, time
, datetime
;
21 from datetime
import datetime
25 if(len(sys
.argv
) >= 2):
27 if(len(sys
.argv
) >= 3):
29 if(len(sys
.argv
) >= 4):
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):
48 prex
= raw_input("Please enter a number to count to: ");
50 prex
= input("Please enter a number to count to: ");
52 if(len(sys
.argv
) <= 2):
54 prey
= raw_input("Please enter a number to start at: ");
56 prey
= input("Please enter a number to start at: ");
58 if(len(sys
.argv
) <= 3):
60 prez
= raw_input("Please enter a number to cont by: ");
62 prez
= input("Please enter a number to cont by: ");
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();
73 if(len(sys
.argv
) >= 5):
82 if(len(sys
.argv
) >= 5):
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):