#自動引用方法
import commonside
inp = input("URL:")
m,f = inp.split('/')
obj = __import__(m)
def main():
if hasattr(obj,f):
func = getattr(obj,f)
func()
else:
print('404')
main()get
下面是commonsinput
def login():
print("login")
def logout():
print("logout")
def home():
print("home")
it
輸出結果:class
URL:commons/home
home
import