-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.random.py
97 lines (81 loc) · 2.35 KB
/
test.random.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/c/python27/python -tt
# -------------+
# Purpose : Short description of script
# - list of features
# Command Line :
# Inputs : Options:
# : --debug: additional outputs for script debug mode
# : Params:
# : None
# : File(s):
# : list of files used by script
# Outputs : 0 - On success
# : 1 - Failed
# Author : YOUR NAME
# Orig Date : DD MON YYYY
# -------------+
# Imported Modules
import os,re,sys,datetime,time,getopt,random
from datetime import datetime
# Local Vars
CAPITOLIZEVARS=''
OUTPUT = False
OUTPUT_FILE = ''
ListNums = []
DICTNums = {}
random_number = random.random()
print (random_number)
random_nums.append(random_number)
print (random_nums[0])
# Process ARGs
try:
options, remainder = getopt.getopt(
sys.argv[1:],
'o:d',
['output=',
'debug',
])
except getopt.GetoptError, err:
print 'ERROR:', err
sys.exit(1)
for opt, arg in options:
if opt in ('-o', '--output'):
outdir = "inv_output"
output_file = '%s/%s' % (outdir,arg)
print "Output filename is %s\n" % (output_file)
if os.path.isdir(outdir): # Run the command mkdir in the system shell
print "yes. there is an existing folder\n"
else:
os.mkdir(outdir) # Run the command mkdir in the system shell
output = True
elif opt in ('-d', '--debug'):
debug = True
# get the list of users from the key files in keydir
UsersList = os.listdir("keydir") # Run the command ls in the system shell
# Count how many users are at this site
TOTALUSERS = len(Users)
if debug:
print 'ARG INFO'
print 'Logfile to scan :', Log_file
print 'debug :', debug
print 'output :', output
##############################################################################
## -------------+
## Name : Module Usage
## Purpose : Displays Module usage
## Inputs : None
## Outputs : None
## -------------+
##############################################################################
def ThisModule():
total = 0
for ITEM in LIST:
print "ITEM = " + CHECK
if stock[ITEM] > 0:
total += prices[ITEM]
print total
stock[ITEM] -= 1
return total
#
# End of script
#