#Python数据分析与挖掘实战

python 多进程并发接口测试实例

#encoding=utf-8import requestsimport jsonimport osimport hashlibprint "register------"data = json.dumps({'username': 'li...

python 练习用python六剑客实现一个统计数字的个数,六剑客:(map、lambda、reduce、filter、切片、推到列表)

统计一共有几个数字 s="sdfa45ads46723" #lambda >>>filter(lambdax:x.isdigit(),list(s))['4','5','4','6','7','2','3']>>>len(filter(lambdax:x...

python excel操作 练习-#操作单列 #操作A到C列 #操作1到3行 #指定一个范围遍历所有行和列 #获取所有行 #获取所有列

##操作单列#操作A到C列#操作1到3行#指定一个范围遍历所有行和列#获取所有行#获取所有列 #coding=utf-8 fromopenpyxlimportWorkbookwb=Workbook()ws1=wb.activews1["A1"]=1ws1["A2"]=2ws1["A3"]=3&nbs...

python excel操作单元格复制和读取的两种方法

操作单元格新建一个sheet,单元格赋值(两种方法)单元格A1赋值为’xiaxiaoxu’单元格A2赋值为‘xufengchai’ 打印A1和A2单元格的值(两种方法)  #coding=utf-8 fromopenpyxlimportWorkbookwb=Workbook()w...

python excel操作 练习:#生成一个excel文件,生成3个sheet,每个sheet的a1写一下sheet的名称。每个sheet有个底色

练习:#生成一个excel文件,生成3个sheet,每个sheet的a1写一下sheet的名称。每个sheet有个底色#coding=utf-8 fromopenpyxlimportWorkbookwb=Workbook()ws1=wb.create_sheet('sheet1',0)ws2=wb.creat...

python excel练习:新建sheet、修改名称、设定颜色、打印sheet名称,复制,保存

练习:新建一个sheet设定一个sheet的插入位置修改sheet的名称为‘xiaxiaoxu’设定该sheet的背景标签的颜色获取全部sheet的名称,打印每个sheet的名称copy一个sheet修改copy的sheet的名称为‘xufegnchai‘保存excel为‘d:\sample.xlsx’#coding=...

python selenium第一个WebDriver脚本

#coding=utf-8fromseleniumimportwebdriverimporttimeimportosos.environ["webdriver.firefox.driver"]="C:ProgramFilesMozillaFirefoxfirefox.exe"driver=webdriver.Firef...

python 文件操作,os.path.walk()的回调函数打印文件名

#coding=utf-8importosdeffind_file(arg,dirname,files):   #foriinarg:       #printi   forfileinfi...

python 文件操作 练习:取得文件的最后存取时间

#coding=utf-8importosimporttimefile_atime=int(os.path.getatime('d:\a.txt'))print"file_atime:",file_atimetime_arr=time.localtime(file_atime)print'time_arr:',time...

python 文件操作 练习:把一个目录下的所有文件名,打印一下,不要包含后缀名

#coding=utf-8importosos.chdir('d:\test2')file_list=os.listdir('.')print"file_list:",file_listprint"*"*100forfileinfile_list:   printos.path.split...

python excel操作

excel操作#coding=utf-8fromopenpyxlimportWorkbookwb=Workbook()   #创建文件对象 #grabtheactiveworksheetws=wb.active    #获取第一个sheet...
代码星球 代码星球·2021-02-12

python 线程、多线程

复习进程知识:python:主进程,至少有一个主线程启动一个新的子进程:Process,pool给每一个进程设定一下执行的任务:传一个函数+函数的参数如果是进程池:map函数:传入一个任务函数+一个序列启动:start多进程执行的时候:如果主进程退出了,子进程还在执行如何让主进程等待子进程执行完毕再退出:调用join函...
代码星球 代码星球·2021-02-12

python pip list 命令列出所有安装包和版本信息

c:Python27Scripts>piplistDEPRECATION:Thedefaultformatwillswitchtocolumnsinthefuture.Youcanuse--format=(legacy|columns)(ordefineaformat=(legacy|columns)inyour...

python xml练习:从database.xml文件取databaselist的ip、name、passwd,写入列表

xml:<?xmlversion='1.1'encoding='utf-8'?><!--thisisatestaboutxml--><databaselisttype='oracle'>   <databaseuserArea='suzhou'&g...

python xml childNodes,childNodes[1].childNodes[0].data例子

xml:<?xmlversion='1.0'encoding='utf-8'?><!--thisisatestaboutxml--><booklisttype='scicenceandenginerring'>   <bookcategory='m...
首页上一页...4546474849...下一页尾页