Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NAME:APPLE
- IMG:1.PNG
- END
- NAME:PEAR
- IMG:1.GIF
- END
- NAME:PEACH
- IMG:2.PNG
- END
- NAME:PEACH
- IMG:2.PNG
- END
- NAME:APPLE
- IMG:1.PNG
- END
- imgTyp="PNG"
- with open("txt1.txt",'r') as f1, open("txt2.txt",'r') as f2:
- f1line=set(f1.read().splitlines())
- f2line=set(f2.read().splitlines())
- for line in f1line:
- if imgTyp in line:
- with open("txtTemp.txt","a") as fTemp:
- fTemp.writelines(**the lines with PNG in txt1 that is missing in txt2, and the line above and under each line**)
- **Then merge f2 and fTemp to get txt3.txt**
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement