Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import csv
- ##################################
- # open file
- ##################################
- # python3
- cpuCsvFile = open("%s/cpu.csv" % (logDir), "w+", newline="")
- cpuCsv = csv.writer(cpuCsvFile)
- # python2
- cpuCsvFile = open("%s/cpu.csv" % (logDir), "wb+")
- cpuCsv = csv.writer(cpuCsvFile)
- #close
- cpuCsv = None
- cpuCsvFile.close()
- ######################################
- # 读写
- ######################################
- cpuCsv.writerow(str)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement