#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
-
class Readfile(object):
-
'''读取/etc/passwd一行一行读取'''
-
def file(chef):
-
file = open('/etc/passwd')
-
c = file.readlines()
-
num = 1
-
for i in c:
-
print num,i.strip()
-
num = num + 1
-
time.sleep(1)
-
print 'read done
-
if __name__=='__main__':
-
f = Readfile()
-
f.file()