ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/Active_prgs/file_counter.py
Revision: 8
Committed: Sat May 5 04:21:19 2012 UTC (13 years, 10 months ago) by ninoborges
Content type: text/x-python
File size: 820 byte(s)
Log Message:
Initial Import

File Contents

# User Rev Content
1 ninoborges 8 # this program will count all of the files in a particular directory.
2     # EBORGES
3     # 11.07.01
4    
5     import sys,os
6     from lgflcntr import getoffice
7    
8     appservers = getoffice()
9    
10     def main():
11     total = 0
12     print "Office/Floor \t | Number of people with LBS"
13     print "-----------------------------------------------"
14     for x in appservers:
15     directory = "/app/log_files/SMS_Problems"
16     #directory = "/app/Lbstrans_users"
17     place = "//" + x + directory
18     try:
19     amount = len(os.listdir(place))
20     except WindowsError:
21     amount = 0
22     total = total + amount
23     print x, "\t \t | \t", amount
24     print '-----------------------------------------------'
25     print '\nTotal\t\t | \t', total
26     print '\n done!'
27    
28     if __name__ == '__main__':
29     main()