gpt4 book ai didi

python - 空行上的语法无效

转载 作者:行者123 更新时间:2023-11-28 19:55:41 24 4
gpt4 key购买 nike

<分区>

出于某种原因,我收到一个错误:

File "prode.py", line 50

^
SyntaxError: invalid syntax

我的代码是这样的:

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

有人知道这是从哪里来的吗?

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com