Python2.7 TypeError:“float”对象不能解释为索引

2024-04-20 12:15:35 发布

您现在位置:Python中文网/ 问答频道 /正文

我只是在github上fork克隆了一个repo inconvergent/hyphae,以便在python2.6到python2.7(然后是3.5)的更新中重用hyphae.py。我修复了一些由于更新而导致的错误,但目前我仍然有TypeError。在

完成

python2.6更新到{},方法是在()之后添加print

修复

File "/home/user/hyphae/hyphae.py", line 378
main()
^
IndentationError: expected an indented block    

通过添加2个空格

使用终端执行python2.7 /home/user/hyphae/hyphae.py

^{pr2}$

关于stackoverflow中的TypeError: 'float' object cannot be interpreted as an index的问题我并不是问得太多,例如Hereotthere,但作为一个笨蛋,我不知道如何解决这个问题。在


Tags: 方法pygithubanhome错误linerepo