図つきは個人ブログに載せました。
sample.py
からほか階層にあるCore.py
を継承したChildren.py
に定義されているhello
メソッドを呼び出したい。
sample.py
# -*- coding: utf-8 -*-
from business.Children import Children
c = Children()
c.hello()
Core.py
# -*- coding: utf-8 -*-
class Core:
def __init__(self):
print('hello core')
Children.py
# -*- coding: utf-8 -*-
from business import Core
class Children(Core.Core):
def __init__(self):
pass
def hello(self):
print('children hello')