0
在Python的终端,我可以运行:SL4A导入失败
import random
random.randint(1,6)
它提供了一个数字,符合市场预期。不过,我保存这个脚本random.py它无法运行:
import random
print random.randint(1,3)
它说:“AttributeError的:‘模块’对象有没有属性‘randint’”
在Python的终端,我可以运行:SL4A导入失败
import random
random.randint(1,6)
它提供了一个数字,符合市场预期。不过,我保存这个脚本random.py它无法运行:
import random
print random.randint(1,3)
它说:“AttributeError的:‘模块’对象有没有属性‘randint’”
尝试保存脚本以外的东西比random.py。它可能导入自己。在再次尝试之前,删除CWD中random.py的旧副本。
重命名工作!我忘了Python中的这种行为,谢谢。 – NoBugs