Python 3.9.2
I keep getting a syntax error and for the life of me, I don't see it:
From the file (lines 558 and 559):
I keep getting a syntax error and for the life of me, I don't see it:
Quote:root@piZERO:~/bin# ./npwAgent.py
File "/root/bin/npwAgent.py", line 559
getCLarguments()
^
SyntaxError: invalid syntax
From the file (lines 558 and 559):
# Get command line arguments. getCLarguments()Here's what it calls:
def getCLarguments(): """ Get command line arguments. There are three possible arguments -d turns on debug mode -v turns on verbose mode -p sets the sensor query period -c sets the chart update period Returns: nothing """ global debugMode, verboseMode, dataRequestInterval, chartUpdateInterval index = 1 while index < len(sys.argv): if sys.argv[index] == '-v': verboseMode = True elif sys.argv[index] == '-d': debugMode = True verboseMode = True elif sys.argv[index] == '-p': try: dataRequestInterval = abs(int(sys.argv[index + 1])) except: print("invalid sensor query period") exit(-1) index += 1 elif sys.argv[index] == '-c': try: chartUpdateInterval = abs(int(sys.argv[index + 1])) except: print("invalid chart update period") exit(-1) index += 1 else: cmd_name = sys.argv[0].split('/') print("Usage: %s [-d | v] [-p seconds] [-c seconds]" \ % cmd_name[-1]) exit(-1) index += 1 ##end def