Python
fyqnb
这个作者很懒,什么都没留下…
展开
-
Python列表(list)使用for循环和list.remove删除列表元素的坑
Python列表(list)使用for循环和list.remove删除列表元素 Talk is cheap show me the code y=[1,1,2,1,2,1,2,1,1,1,2] index = 0 for i in y: if i==1: print() y.remove(i) print(index,":","List_2=",y," i:",i) index += 1 print("List_2=",y)``` 首先我们先看一下原创 2021-09-13 15:55:34 · 785 阅读 · 0 评论 -
Python open函数文件名格式的坑
错误代码如下: file_title_time = time.strftime('%Y%m%d-%H:%M:%S',time.localtime(time.time())) # print("D:/process_monitor_" + p.name() + '_' + file_title_time+ '_'+str(pid) + ".csv") with open("D:/process_monitor_" + p.name() + '_'+ file_title_time+ '_' + str(pid原创 2021-07-28 18:10:05 · 614 阅读 · 0 评论