詳細如下:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
pathlog = "/usr/local/nginx/log"
files = os.listdir(pathlog)
for f in files:
if 'stat' in f and f.endswith('.log'):
print ("Found it! " + f)
運行結果就是查詢到的結果
本文參考:
詳細如下:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
pathlog = "/usr/local/nginx/log"
files = os.listdir(pathlog)
for f in files:
if 'stat' in f and f.endswith('.log'):
print ("Found it! " + f)
運行結果就是查詢到的結果
本文參考: