Commit f842fe67 by Ethan Mertz

adding variable stuff

parent 5dfdece2
import re
import jellyfish
import glob
var = "[\s]*([\w, ]+)[\s]*=[^=]"
def get_unique_vars(filename):
unique_vs = set()
with open(filename) as f:
ft = f.read()
vs = re.findall(var, ft)
if vs:
for v in vs:
for st in v.strip().split(","):
unique_vs.add(st.strip())
return unique_vs
def main():
count = 0
for filename in glob.glob("pydata/pyfile*.txt"):
print("working on " + filename)
s = get_unique_vars(filename)
with open("pyvariables/varfile" + str(count) + ".txt", "w") as f:
f.write(repr(s))
count += 1
if __name__ == '__main__':
main()
graph.png

47.6 KB

Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment