import uuid import pandas as pd def generate_id(name): # 生成一个UUID unique_id = str(uuid.uuid5(uuid.NAMESPACE_URL, name)).replace("-", "")[:12] # 将UUID转换为字符串,并添加指定的前缀 return unique_id clientId = [] uuid_version = [] name = [] for i in range(50): generated_id = "farm_" + generate_id(str(i)) name.append(str(i)) uuid_version.append("uuid5") clientId.append(generated_id) df = pd.DataFrame({"clientId": clientId, "name": name, "uuid_version": uuid_version}) df.to_csv("clientId.csv", index=False, sep=",")