Python报错解决:Process finished with exit code -1073741571 (0xC00000FD)和RecursionError: maximum recursion depth exceeded in comparison

2020/04/27 行走的问题解决机 共 260 字,约 1 分钟

早上写代码时遇到了报错:

  [Previous line repeated 2974 more times]
    trade_flag = ((now_price - avg) / avg) > LONG_RATE
RecursionError: maximum recursion depth exceeded in comparison
Process finished with exit code -1073741571 (0xC00000FD)

根据网上的资料,这个报错是因为函数的递归太深了。

我查看了代码,确实有一段代码写的有问题,递归太深了。

把递归改为迭代就可以了。

文档信息

Table of Contents