请问一下,我从网络教学资源copy了以下的code
#encrypt.py
import random
class Encrypt:
def setCode(self):
self.code = [chr(i) for i in range(97, 123)]
random.shuffle(self.code)
def getCode(self):
return "".join(self.code)
def toEncode(self):
return "toEncode"
def toDecode(self):
return "toDecode"
e = Encrypt()
e.setCode()
print()
print(e.getCode())
print(e.toEncode())
print(e.toDecode())
print()
=================
然后我在Shell里
import encrypt
它也的确会print出字串
但当我把encrypt.py改名为test.py,然后输入
import test
它反而不动了
为什么呢?谢谢