Python SL4A导入失败

Python SL4A导入失败,python,sl4a,Python,Sl4a,在Python终端,我可以运行: import random random.randint(1,6) 正如预期的那样,它给出了一个数字。但是,我将此脚本另存为random.py,但无法运行: import random print random.randint(1,3) 它说“AttributeError:'module'对象没有属性'randint'”请尝试将脚本保存为random.py以外的内容。它可能正在导入自己。请删除CWD中random.py的旧副本,然后重试。重命名成功!我忘记了

在Python终端,我可以运行:

import random
random.randint(1,6)
正如预期的那样,它给出了一个数字。但是,我将此脚本另存为random.py,但无法运行:

import random
print random.randint(1,3)

它说“AttributeError:'module'对象没有属性'randint'”

请尝试将脚本保存为random.py以外的内容。它可能正在导入自己。请删除CWD中random.py的旧副本,然后重试。

重命名成功!我忘记了Python中的这种行为,谢谢。