
python基础知识
文章平均质量分 85
ArcherGL
热爱技术,热爱思考平淡无奇的小骚年
展开
-
python生成TXT文件及转换为CSV文件源码
import datetimewith open(“D:/Luster/4.文档/CCDPoint.txt”,“w”) as f:f.write(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))f.write("\r \n")def CCD1Point(x,y,z,r,step):CCD1=[[x,y,z,r],[x+step,y-step,z,r],[x-step,y+step,z,r],[x-step,y-step,z,r],[x+s原创 2021-04-10 23:01:37 · 205 阅读 · 0 评论 -
Python基础知识记要
Python基础知识记要一.列表注意点:1.列表中的元素可以是不同的类型2.列表中的元素可以是不同的列表3.读取一个列表中的列表 list[3][1]4.index 返回list.index的索引值5.可以修改列表对象的元素6.list.insert(index,Value) 插入 在某一个索引的位置7.del list[index] 删除列表指定的索引值8.列表包容 a=“PY” n=[1,2,3,4]print([(x,y) for x in a for y in n])9.列表原创 2021-02-20 19:52:58 · 301 阅读 · 1 评论