s5启动文件配置
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user