我在Python中调用一个函数,像这样:
这是函数文档中的代码示例:
出现了这样的错误:
如何解决这个错误?
order_id = kite.order_place(
self, exchange, tradingsymbol, transaction_type,
quantity, price, product, order_type, validity,
disclosed_quantity=None, trigger_price=None, squareoff_value,
stoploss_value, trailing_stoploss, variety, tag='')
这是函数文档中的代码示例:
def order_place(
self, exchange, tradingsymbol, transaction_type,
quantity, price=None, product=None, order_type=None, validity=None,
disclosed_quantity=None, trigger_price=None, squareoff_value=None,
stoploss_value=None, trailing_stoploss=None, variety='regular', tag='')
出现了这样的错误:
File "csvr.py", line 7
stoploss_value, trailing_stoploss, variety, tag='')
^
SyntaxError: positional argument follows keyword argument
如何解决这个错误?
function1("arg1", "arg2", "arg3")
或者你可以这样指定它们:function1(arg3="arg3", arg1="arg1", arg2="arg2"
(假设每个参数都是可选的)。 - 255.tar.xz