where com is an array list of computer name
the file look something like "capacity_DTCP-TSAIME002_20130512.csv"
At the moment it compare every file with the string(name)
- Code: Select all
for com in comList:
path = 'D:\\StatsScript\\download\\AppStats'
for files in os.walk('.'):
for file in files:
if ( str(file).lower() == ("capacity_" + com + "_" + str(d.strftime('%Y%m%d')) + ".csv" ).lower() ):
infile = csv.reader(open(file,"r"))
fb = open(file,"r")
Since I know the exact name of the coputer
e.g. comList = ['US1S-TSDAAPP01', 'US1S-TSDAAPP02', 'US1S-TSDAAPP03', 'US1S-TSDAAPP04']
Im want to do something like this
path = 'D:\\StatsScript\\download\\AppStats\\"capacity_" + com + "_" + str(d.strftime('%Y%m%d')) + ".csv'
which might make my program run faster, however it doesn't let me use this kind of syntax.