Sep-15-2018, 11:18 PM
Every week I have to insert scores for 7 classes, so I am trying to automate this as much as possible.
I now have 6 routines which all work in my idle3 shell and in a bash terminal in Ubuntu 18.04 and do everything I need.
The routines are:
copyOldData
insert3Cols
getScoresInsertScores
calculatePercentScores
paintColumnsYellow
insertPhotos
The last one puts the photos back, because openpyxl does not load images.
I want to put these all in one program. None of these routines take any parameters, they just do their job and finish with
print('All done')
I thought I could define each routine as a function:
def copyOldData()
mycode ...
def insert3Cols()
mycode ...
def getScoresInsertScores()
mycode ...
def calculatePercentScores()
mycode ...
def paintColumnsYellow()
mycode ...
def insertPhotos()
mycode ...
Then define main()
def main()
copyOldData()
insert3Cols()
getScoresInsertScores()
calculatePercentScores()
paintColumnsYellow()
insertPhotos()
Then just write:
go = main()
But this does not work, it stops at
What is the best way to link these 6 routines to run sequentially?
I now have 6 routines which all work in my idle3 shell and in a bash terminal in Ubuntu 18.04 and do everything I need.
The routines are:
copyOldData
insert3Cols
getScoresInsertScores
calculatePercentScores
paintColumnsYellow
insertPhotos
The last one puts the photos back, because openpyxl does not load images.
I want to put these all in one program. None of these routines take any parameters, they just do their job and finish with
print('All done')
I thought I could define each routine as a function:
def copyOldData()
mycode ...
def insert3Cols()
mycode ...
def getScoresInsertScores()
mycode ...
def calculatePercentScores()
mycode ...
def paintColumnsYellow()
mycode ...
def insertPhotos()
mycode ...
Then define main()
def main()
copyOldData()
insert3Cols()
getScoresInsertScores()
calculatePercentScores()
paintColumnsYellow()
insertPhotos()
Then just write:
go = main()
But this does not work, it stops at
Quote:pedro@pedro-newssd:~/insertScores/python$ ./allStepsIn1.py
File "./allStepsIn1.py", line 6
def copyOldData
^
SyntaxError: invalid syntax
pedro@pedro-newssd:~/insertScores/python$
What is the best way to link these 6 routines to run sequentially?