Mercurial > codedump
view gettimefromedls.py @ 116:205fc01d5eb4
kmbscreens: replace bat+c with py
committer: GitHub <noreply@github.com>
author | Paper <37962225+mrpapersonic@users.noreply.github.com> |
---|---|
date | Sat, 04 Feb 2023 13:46:06 -0500 |
parents | a972dc788da0 |
children |
line wrap: on
line source
# get timestamps from Vegas EDL files # used in my unfinished compilation import sys import os import re parsedfl = [] def main(argv): with open(argv[1]) as fl: next(fl) i = 0 for line in fl.readlines(): # I LOVE REGEX!!! match = re.search("\d+; \d+; (\d+\.\d+); \d+\.\d+; \d+\.\d+; .+?; .+?; \d+; .+?; .+?; .+?; \"(.+?)\";", line) if match: parsedfl.append(match.group(1, 2)) i += 1 for i in parsedfl: print("%d:%02d: %s" % (round(float(i[0]) / 1000) / 60, round(float(i[0]) / 1000) % 60, os.path.basename(i[1]))) if __name__ == "__main__": main(sys.argv)