举个例子:

import csv
import os

path='/tmp/'
file='test.csv'
def generate_csv(path,file):
    if not os.path.exists(path):
        os.mkdir(path)
    files=os.path.join(path,file)
    # os.system('touch %s' %files)
    with open(files,'w') as f:
        writer=csv.writer(f)
        writer.writerow(['client_name','os..','path'])
    return files

def main():
    generate_csv(path,file)

if __name__=='__main__':
    main()

 

相关文章:

  • 2022-12-23
  • 2021-12-04
  • 2021-09-14
  • 2022-12-23
  • 2022-12-23
  • 2021-09-07
  • 2021-10-23
  • 2022-12-23
猜你喜欢
  • 2021-04-10
  • 2021-07-27
  • 2021-07-24
  • 2021-07-11
  • 2021-12-19
  • 2022-12-23
  • 2020-01-15
相关资源
相似解决方案