Settings: Filename Format Set
and small changes to follow PEP8 code style change default README to Chinese
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
"""该程序的自述信息,调用即输出"""
|
||||
from modules.utils.clear_screen import clear
|
||||
"""有关打印的函数"""
|
||||
from colorama import Fore
|
||||
|
||||
from modules.utils.clear_screen import clear
|
||||
from modules.utils.inputs import rinput
|
||||
|
||||
|
||||
def print_info(self):
|
||||
"""调用即输出,无返回值"""
|
||||
@@ -25,6 +27,17 @@ def print_info(self):
|
||||
|
||||
|
||||
def print_menu(menu: dict):
|
||||
"""传入一个字典, 格式为 {"需要输入的字符": "功能描述", ...}"""
|
||||
"""传入一个字典, 格式为 {"需要输入的字符": "功能描述", ...}
|
||||
将会按照以下格式打印:
|
||||
[字符1] 功能描述1
|
||||
[字符2] 功能描述2
|
||||
..."""
|
||||
for k, v in menu.items():
|
||||
print(f"{Fore.LIGHTBLUE_EX}[{k}] {Fore.LIGHTWHITE_EX}{v}")
|
||||
print(f"{Fore.LIGHTBLUE_EX}[{k}] {Fore.RESET}{v}")
|
||||
|
||||
|
||||
def input_menu(menu: dict):
|
||||
"""传入一个字典, 格式为 {"需要输入的字符": "功能描述", ...}
|
||||
在 print_menu 末尾添加'请选择: '字样并要求输入, 使用rinput获取输入"""
|
||||
print_menu(menu)
|
||||
return rinput("请选择: ")
|
||||
|
||||
Reference in New Issue
Block a user