File size: 623 Bytes
eefa3af |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import csv
import random
def new_output_file(username):
# Generate a random 6-digit number for the filename
random_number = random.randint(100000, 999999)
filename = f'/Users/yunshi/Downloads/360Data/Data Center/Working-On Task/演讲与培训/2023ChatGPT/Coding/gradio/中交建/产品演示DEMO/交付_文本清洗/{username}/output_{random_number}.csv'
# Create a new CSV file with 2 columns, ID and output.
with open(filename, 'w', newline='') as file:
writer = csv.writer(file)
# Write the header row
writer.writerow(['ID', 'output'])
return filename |