python from cement import App, Controller, ex class MyController(Controller): class Meta: label = 'mycontroller' stack_on = 'base' stack_order = 10 @ex(help='This is my command') def mycommand(self): print('Hello, World!') class MyApp(App): class Meta: label = 'myapp' base_controller = 'base' def setup(self): pass def run(self): self.app_args.parsed_command.run() if __name__ == '__main__': with MyApp() as app: app.run()


上一篇:
下一篇:
切换中文