Off topic:how to read contents of files with same name but in different directory
0
0
Entering edit mode
5.3 years ago
howardha98 • 0

Hi I have a python question: I tried to write a script that would print out the contents of files with same name but located in many different directories . But somehow it doesnt seem to work. Can you please help??

lvspath = "/org/seg/projects/n5t/scv/users/hha/safe1/PDV/dsg_scla_en_1r1w*/lvs/lvs.sum" # Can I use wild card here?
    with open(lvspath) as f:
       head = f.readlines()[1:4]  #just want to read 5 lines per file
       for line in head:
           print line,
python • 285 views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 1400 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6