-
Notifications
You must be signed in to change notification settings - Fork 0
/
settle_test.py
40 lines (34 loc) · 953 Bytes
/
settle_test.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
# -*- coding: cp1251 -*-
# Ñêðèïò ïðîâåðêè àêòèâ
import subprocess as sp
import fnmatch
import os
import sys
#1. first buld SET of recharged cards
rc_file=open('C:\\Share_transport\\autoscript\\recharged_.csv')
rc_text=rc_file.read()
rc_ls=rc_text.split('\n')
RC=set(rc_ls)
print (len(RC))
RC.discard('')
print (len(RC))
#2. buld SET of used cards
uc_file=open('C:\\Share_transport\\autoscript\\usedcard_.csv')
uc_text=uc_file.read()
uc_ls=uc_text.split('\n')
UC=set(uc_ls)
print (len(UC))
UC.discard('')
print (len(UC))
logfile = open('settle_log.txt','w')
logfile.write( 'Êàðòû åçäèëè, íî íå ïîïîëíÿëèñü: '+str(len(UC-RC))+'\n')
L=list(UC-RC)
L.sort()
for n in L:
logfile.write(n+'\n')
logfile.write( 'Êàðòû ïîïîëíåíû íà îò÷åòíûé ìåñÿö, íî íå åçäèëè â íåì: '+str(len(RC-UC))+'\n')
M=list(RC-UC)
M.sort()
for n in M:
logfile.write(n+'\n')
print (' ïîäðîáíîñòè â settle_log.txt')