I have a silly confusion here. I have the following main() in my code and I pass transcriptionFile and phonemeFile as inputs. Is it the time() function that is called first and then the coart() function? But I input the files together that are passed in these functions in a single line, so don’t they have to be called at the same time?
I am just a beginner in python. I was working on the time() function and coart() function separately but now I have to pass a list generated in coart() function to time() function. So, if time() function is called first then it wouldn’t recognize the list even if I pass it. I hope I made my question clear. Thank you.
if __name__ == "__main__" :
if len(sys.argv) != 3 :
Usage()
else :
transcriptionFile = sys.argv[1]
time("transcriptions.txt")
phonemeFile = sys.argv[2]
coart("syllabifiedPhonemes.txt")
Statements are always executed in the order listed. So in your case, sys.argv[1] will first be assigned to the global variable transcriptionFile. Then, the time function will be called. Then the value of sys.argv[2] will be assigned to the phonemeFile variable, and finally the coart function will be called. If the time function uses something that the coart function produces, then you will need to call the coart function first. It doesn’t matter than your command line parameters in sys.argv occur in a different order.