For some reason, I'm getting an error:
File "prode.py", line 50
^
SyntaxError: invalid syntax
This is what my code looks like:
def start():
#Is the user trying to get pixel or percentage data,
if (len(sys.argv)) == 4:
if (sys.argv[1]) == "-px":
pct = float(sys.argv[2])
pxl = float(sys.argv[3])
divByCent = pct*pxl
ans = divByCent/100
print "%f pct of %f px = %f px" % (pct, pxl, ans)
elif (sys.argv[1]) == "-pe":
pxlOne = float(sys.argv[2])
pxlTwo = float(sys.argv[3])
divByTwo = pxlOne * 100
ans = divByTwo / 1280
print "%f pxl of %f pxl = %f pct" % (pxlOne, pxlTwo, ans)
#Or something based on a ratio?
elif (len(sys.argv) == 3):
if (sys.argv[1] == "-use"): ratioCalc = Ratio(float(sys.argv[2]), float(sys.argv[3])
#Line 50
Does anybody know where this is coming from?
You've missed last parenthesis:
if (sys.argv[1] == "-use"): ratioCalc = Ratio(float(sys.argv[2]), float(sys.argv[3]))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With