Hello.
import csv
from datetime import datetime
ch=0
date=datetime.now()
data=[4,54,65,87,37,83,42,90,3,43]
csvfile=open('c:/test.csv','w',newline='')
csvwriter=csv.writer(csvfile)
csvwriter.writerow([ch,date,data])
csvfile.close()
If you run this code, you will see a test.csv file with
By any chance
I want to save it like this, but I don't know how to write a repeat sentence I don't know. Can you tell me? python csv
import csv
from datetime import datetime
ch=0
date=datetime.now()
data=[4,54,65,87,37,83,42,90,3,43]
csvfile=open('./test.csv','w',newline='')
csvwriter=csv.writer(csvfile)
csvwriter.writerow([ch,date,data])
#0 | 04:05.6 | [4, 54, 65, 87, 37, 83, 42, 90, 3, 43]
csvwriter.writerow([ch,date]+data)
#0 | 04:50.1 | 4 | 54 | 65 | 87 | 37 | 83 | 42 | 90 | 3 | 43
csvfile.close()
563 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
861 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
589 GDB gets version error when attempting to debug with the Presense SDK (IDE)
563 Who developed the "avformat-59.dll" that comes with FFmpeg?
© 2024 OneMinuteCode. All rights reserved.