早上写代码时遇到了报错:
[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)
根据网上的资料,这个报错是因为函数的递归太深了。
我查看了代码,确实有一段代码写的有问题,递归太深了。
把递归改为迭代就可以了。
文档信息
- 本文作者:last2win
- 本文链接:https://last2win.com/2020/04/27/python-error/
- 版权声明:自由转载-非商用-非衍生-保持署名(创意共享3.0许可证)