Anonymous user
Text processing/Max licenses in use: Difference between revisions
→{{header|Python}}: Update for Python 2.7 & 3.X compatability
(→{{header|REXX}}: added comments in 2nd section header about what REXXes return what ENV strings. -- ~~~~) |
(→{{header|Python}}: Update for Python 2.7 & 3.X compatability) |
||
Line 1,497:
=={{header|Python}}==
<lang python>out, max_out, max_times = 0, -1, []
for job in open('mlijobs.txt'):
out += 1 if "OUT" in job
out += 1▼
if out > max_out:
max_out, max_times = out, []
if out == max_out:
max_times.append(job.split()[3])
print(' ' + '\n '.join(max_times))</lang>
{{out}}
▲print "Maximum simultaneous license use is", max_out, "at the following times:"
<pre>Maximum simultaneous license use is 99 at the following times:
2008/10/03_08:39:34
|