python write list to file 在 Writing a list to a file with Python, with newlines - Stack Overflow 的評價
Use a loop: with open('your_file.txt', 'w') as f: for line in lines: f.write(f"{line}\n"). For Python <3.6: with open('your_file.txt', 'w') as f: for line ... ... <看更多>