pip3 install pandas
Install the Pandas library with the above command.
import pandas as pd
output = {
"a": [1, 2, 3, 4, 5],
"b": ["I", "II", "III", "IV", "V"],
"c": ["p", "q", "r", "s", "t"],
}
df = pd.DataFrame(output)
df.to_csv("filename.csv", index=False, encoding="utf-8")
Output:
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…