Python Forum
How can I link these 6 routines to run sequentially?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I link these 6 routines to run sequentially?
#1
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

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?
Reply


Messages In This Thread
How can I link these 6 routines to run sequentially? - by Pedroski55 - Sep-15-2018, 11:18 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Are list/dict comprehensions interpreted really sequentially? anata2047 3 1,475 May-31-2022, 08:43 PM
Last Post: Gribouillis
  How to call multiple functions sequentially Mayo 2 9,446 Jan-06-2021, 07:37 PM
Last Post: Mayo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020