0.1.70
This commit is contained in:
		| @@ -1,6 +1,6 @@ | ||||
| Metadata-Version: 2.1 | ||||
| Name: guan | ||||
| Version: 0.1.69 | ||||
| Version: 0.1.70 | ||||
| Summary: An open source python package | ||||
| Home-page: https://py.guanjihuan.com | ||||
| Author: guanjihuan | ||||
|   | ||||
| @@ -6,7 +6,7 @@ import guan | ||||
| def test(): | ||||
|     import guan | ||||
|     current_version = guan.get_current_version('guan') | ||||
|     print(f'\nCongratulations on successfully installing Guan package! The installed version is guan-{current_version}.') | ||||
|     print(f'Congratulations on successfully installing Guan package! The installed version is guan-{current_version}.') | ||||
|  | ||||
| # 泡利矩阵 | ||||
| @guan.statistics_decorator | ||||
|   | ||||
| @@ -402,6 +402,34 @@ def color_matplotlib(): | ||||
|     color_array = ['tab:blue', 'tab:orange', 'tab:green', 'tab:red', 'tab:purple', 'tab:brown', 'tab:pink', 'tab:gray', 'tab:olive', 'tab:cyan'] | ||||
|     return color_array | ||||
|  | ||||
| # 如果不存在文件夹,则新建文件夹 | ||||
| @guan.statistics_decorator | ||||
| def make_directory(directory='./test'): | ||||
|     import os | ||||
|     if not os.path.exists(directory): | ||||
|         os.makedirs(directory) | ||||
|  | ||||
| # 如果不存在文件,则新建空文件 | ||||
| @guan.statistics_decorator | ||||
| def make_file(file_path='./a.txt'): | ||||
|     import os | ||||
|     if not os.path.exists(file_path): | ||||
|         with open(file_path, 'w') as f: | ||||
|             pass | ||||
|  | ||||
| # 读取文本文件内容,如果不存在,则新建空文件 | ||||
| @guan.statistics_decorator | ||||
| def read_text_file(file_path='./a.txt'): | ||||
|     import os | ||||
|     if not os.path.exists(file_path): | ||||
|         with open(file_path, 'w') as f: | ||||
|             pass | ||||
|         return '' | ||||
|     else: | ||||
|         with open(file_path, 'r') as f: | ||||
|             content = f.read() | ||||
|         return content | ||||
|  | ||||
| # 将变量存到文件 | ||||
| @guan.statistics_decorator | ||||
| def dump_data(data, filename, file_format='.txt'): | ||||
|   | ||||
| @@ -1,13 +1,6 @@ | ||||
| # Module: others | ||||
| import guan | ||||
|  | ||||
| # 如果不存在文件夹,则新建文件夹 | ||||
| @guan.statistics_decorator | ||||
| def make_directory(directory='./test'): | ||||
|     import os | ||||
|     if not os.path.exists(directory): | ||||
|         os.makedirs(directory) | ||||
|  | ||||
| # 获取当前日期字符串 | ||||
| @guan.statistics_decorator | ||||
| def get_date(bar=True): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user