1、虚拟环境配置
把主要的环境继承到自身以后,创建一个单独的环境隔离起来。
2、csv文件读取
文件读写:
def txt_writer():
‘’’’’’写文件‘’‘’‘’
with open(‘data.txt’,’w’.encoding=‘utf-8p)as f:
f.write()
lines=[
]
f.writelines(lines)
def txt_read()
‘’’’’’读文件’’’’’’
with open(‘data.txt’,encoding=‘utf-8’)as f:
for line in f:
print(line)
if__name__==‘__main__’:
txt_read()
csv读取
import csv
def csv_read():
‘’’’’’csv基本读取’’’’’’
with open(‘product.csv’,encoding=‘utf8’)as f:
reader = csv.reader(f)
headers=next(reader)
print(headers)
for row in reader:
print(row)
if__name__==‘__main__’:
csv_read()