1
tập trung vào
0
Người theo dõi

Cách sử dụng try, except nếu lỗi này xảy ra trong Python

Được tạo ra trong: 2021-12-01 12:00:09, cập nhật trên:
comments   11
hits   891

Sai lầm Sell(581.63, 0.01): 400: {“code”:-4024,“msg”:“Limit price can’t be lower than 600.087”} Mã của tôi. def sell(currency,price,amount): Log(“sell currency: “, currency) set_precision(currency) exchange.SetDirection(“sell”) id1 = 0 k = 0 while (id1 == 0 and k == 0): try: id1 = exchange.Sell(price, amount) Log(“price: “, price) Log(“amount: “, amount) k = 1 Log(“k: “, k) except: cancel_all_sell_order(currency) continue return id1

Không có vào except, xin hỏi tại sao