SHARE
TWEET

Untitled

a guest Aug 20th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top