s5启动文件配置

This commit is contained in:
leon_mac
2025-11-14 23:38:58 +08:00
parent d8b738d0b7
commit 86ce9cda87
9 changed files with 223 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
import json
def writ_json_file(root_folder_path,sart_index_num, file_total_count,target_ip,start_listen_port) :
for i,v in enumerate(range(sart_index_num, sart_index_num + file_total_count)):
# 定义一个json
port = str(start_listen_port + i)
target = target_ip + ":" + port
json_config = {
"server": target,
"port": ":"+ port,
}
print(json_config)
# 写对应文件
with open(f'{root_folder_path}/{v}.json', 'w', encoding='utf-8') as json_file:
json.dump(json_config, json_file, indent=4)