#!/usr/bin/env python3 #coding:utf-8 import cmd completions = [ 'Mage Slayer (Alara Reborn)', 'Magefire Wings (Alara Reborn)', 'Sages of the Anima (Alara Reborn)', 'Sanctum Plowbeast (Alara Reborn)', 'Sangrite Backlash (Alara Reborn)', 'Sanity Gnawers (Alara Reborn)', 'Sen Triplets (Alara Reborn)' ] class principale(cmd.Cmd): intro = "bonjour" prompt = "(principal) " def do_add(self, arg): pass def complete_add(self, text, line, begidx, endidx): mline = line.partition(' ')[2] offs = len(mline) - len(text) return [s[offs:] for s in completions if s.startswith(mline)] def do_secondaire(self, arg): secondaire().cmdloop() def do_exit(self, arg): return True def do_q(self, arg): return True class secondaire(cmd.Cmd): prompt = "(principale - secondaire) " def do_exit(self, arg): return True principale().cmdloop()