TypeError:“模块”对象不可调用python

时间:2019-12-28 08:40:23

标签: python python-3.x

我知道这个错误非常普遍,我尝试从这些答案中寻求解决方案,但结果相同

所以我有3个Python文件,可由用户输入调用。我的代码看起来像这样

(主要)第一个文件

php artisan migrate:refresh --seed

第二个文件

class main:
    #random code here

class testo:
   def steve(self):
       obs = input ('Enter : ')
       if obs == 'P':
           import second
           second()
       elif obs == 'N':
           import third
           third()
obj=testo()
obj.seteve()

第三个文件(此文件出错)

class main:
   #random code here
class llama:
   def clear_text(text):
       sam = input ('Enter : ')
       if sam == 'X':
           from first import steve
       elif sam == 'N':
           import third
           third()
obj=llama()

我的第一个和第二个文件运行良好,可以互相调用。

但是,当我尝试从main调用我的第三个文件并键入任何内容并按Enter时,它将引发此错误。

class ender:
   def draco(text):
       cin = input ('Enter : ')
       if cin == 'X':
           from first import steve
       elif cin == 'T':
           print ('testing')
       else:
           print('nope')
obj = ender()
obj.draco()

我在做什么错??

0 个答案:

没有答案
相关问题