Change file structure
This commit is contained in:
0
modules/utils/__init__.py
Normal file
0
modules/utils/__init__.py
Normal file
12
modules/utils/clear_screen.py
Normal file
12
modules/utils/clear_screen.py
Normal file
@@ -0,0 +1,12 @@
|
||||
"""包含一个函数,用来清空命令行的信息,自动判别系统"""
|
||||
import os
|
||||
|
||||
|
||||
def clear():
|
||||
name = os.name
|
||||
if name == "nt":
|
||||
os.system("cls")
|
||||
elif name == "posix":
|
||||
os.system("clear")
|
||||
else:
|
||||
os.system("clear")
|
24
modules/utils/information.py
Normal file
24
modules/utils/information.py
Normal file
@@ -0,0 +1,24 @@
|
||||
"""该程序的自述信息,调用即输出"""
|
||||
from modules.utils.clear_screen import clear
|
||||
|
||||
|
||||
def print_info(self):
|
||||
"""调用即输出,无返回值"""
|
||||
clear()
|
||||
print(f"""[NeteaseMusicLyricDownloader]
|
||||
版本: {self.version}
|
||||
本软件开源,项目地址:https://github.com/1826013250/NeteaseMusicLyricDownloader
|
||||
作者:David-123
|
||||
联系方式:
|
||||
\tQQ:1826013250
|
||||
\tE-mail:1826013250@qq.com(mainly)
|
||||
\t mc1826013250@gmail.com
|
||||
|
||||
特别感谢:
|
||||
\t- nondanee - ncmdump https://github.com/nondanee/ncmdump
|
||||
\t- QCloudHao - 保存了完整的ncmdump源代码 https://github.com/QCloudHao/ncmdump
|
||||
\t- chuyaoxin - 提供了对ncmdump以及ncm文件的详细解说 https://www.cnblogs.com/cyx-b/p/13443003.html
|
||||
|
||||
若程序遇到bug请提交至github上的issue""")
|
||||
input("按回车键返回...")
|
||||
return
|
11
modules/utils/inputs.py
Normal file
11
modules/utils/inputs.py
Normal file
@@ -0,0 +1,11 @@
|
||||
"""该模块提供几个自定义处理输入函数"""
|
||||
|
||||
|
||||
def rinput(string: str = ''):
|
||||
"""当调用该函数时,同input()一样,但是返回一个去除首尾空格并全部小写的str"""
|
||||
return input(string).strip().lower()
|
||||
|
||||
|
||||
def cinput(string: str = ''):
|
||||
"""当调用该函数时,同input()一样,但是返回一个去除首尾空格的str"""
|
||||
return input(string).strip()
|
11
modules/utils/raw_input.py
Normal file
11
modules/utils/raw_input.py
Normal file
@@ -0,0 +1,11 @@
|
||||
"""该模块提供几个自定义处理输入函数"""
|
||||
|
||||
|
||||
def rinput(string: str = ''):
|
||||
"""当调用该函数时,同input()一样,但是返回一个去除首位空格并全部小写的str"""
|
||||
return input(string).strip().lower()
|
||||
|
||||
|
||||
def cinput(string: str = ''):
|
||||
"""当调用该函数时,同input()一样,但是返回一个去除首尾空格的str"""
|
||||
return input(string).strip()
|
Reference in New Issue
Block a user