Fix lint errors, adding a formatter

This commit is contained in:
Yuval Goldberg
2020-10-18 11:16:48 +03:00
parent 4331db74d0
commit 0ab9edf57b
4 changed files with 247 additions and 153 deletions

View File

@@ -1,10 +1,10 @@
#To use, paste at bottom of mathgen.py code, change line variable and remove all table rows in README.md except for the top 2 and run mathgen.py
# To use, paste at bottom of mathgen.py code, change line variable and remove all table rows in README.md except for the top 2 and run mathgen.py
wList = getGenList()
allRows = []
f=open('mathgen.py')
lines=f.readlines()
line = 720 #This has to be changed depending on which line the first generator appears on
f = open('mathgen.py')
lines = f.readlines()
line = 720 # This has to be changed depending on which line the first generator appears on
for item in wList:
myGen = item[2]
prob, sol = myGen()
@@ -13,10 +13,10 @@ for item in wList:
instName = lines[line]
def_name = instName[:instName.find('=')].strip()
row = [myGen.id, myGen.title, prob, sol, def_name]
line+=1
line += 1
allRows.append(row)
g=open('../README.md', "a")
g = open('../README.md', "a")
for row in allRows:
tableLine = "| " + str(row[0]) + " | " + str(row[1]) + " | " + str(row[2]) + " | " + str(row[3]) + " | " + str(row[4]) + " |\n"
g.write(tableLine)