一个简单的概念示例源码:
https://github.com/codejam1024/new-idea
以前不是要在文件开头 import 或者 using 来导入其他模块吗, 现在只要我访问了 app.web ,就会自动导入 web 模块,访问到了 app.console,就会自动导入 console 模块
化繁为简,世间万物皆对象
以 app 为起点
app.无限可能
app.人.走()
app.人.性别
抛弃了之前的复杂的导入和引用方式, import 或 using, 还有什么命名空间, 主要还看我 github 上的源码,希望各位发表各自的观点
app = []
def run():
print('core run.')
print('last config host : ' + app.config.host)
print('last config port : ' + app.config.port)
host = input('Input server host(127.0.0.1):') or '127.0.0.1'
port = input('Input server port(8080):') or '8080'
app.config.host = host
app.config.port = port
app.config.save()
app.server.run()