summaryrefslogtreecommitdiff
path: root/test/Fortran/fixture/myfortran.py
blob: 6b4e5ef140a1cccc4a33cc320a1b7db2559da739 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import getopt
import sys

print(sys.argv)
comment = ('#' + sys.argv[1]).encode()

opts, args = getopt.getopt(sys.argv[2:], 'cf:o:K:')
for opt, arg in opts:
    if opt == '-o':
        out = arg

with open(args[0], 'rb') as infile, open(out, 'wb') as outfile:
    for l in infile:
        if not l.startswith(comment):
            outfile.write(l)

sys.exit(0)