Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3
- files = ['../BigInteger.h', '../Finite.h', '../Rational.h', '../Matrix.h']
- read_files = []
- for f in files:
- read_files.append(open(f).readlines())
- includes = set()
- for i in read_files:
- for line in i:
- if line[0] == '#': includes.add(line)
- output = open('matrix.h', 'w')
- for i in includes:
- if i.startswith('#include') and not i.count('"'):
- print(i, file=output, end='')
- for f in read_files:
- for line in f:
- if line[0] != '#':
- print(line, file=output, end='')
- output.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement