Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. import csv
  2.  
  3. ##################################
  4. # open file
  5. ##################################
  6. # python3
  7. cpuCsvFile = open("%s/cpu.csv" % (logDir), "w+", newline="")
  8. cpuCsv = csv.writer(cpuCsvFile)
  9. # python2
  10. cpuCsvFile = open("%s/cpu.csv" % (logDir), "wb+")
  11. cpuCsv = csv.writer(cpuCsvFile)
  12.  
  13. #close
  14. cpuCsv = None
  15. cpuCsvFile.close()
  16.  
  17. ######################################
  18. # 读写
  19. ######################################
  20. cpuCsv.writerow(str)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement