当前位置: 首页 > news >正文

魏县住房和城乡建设局网站wordpress怎么调中文

魏县住房和城乡建设局网站,wordpress怎么调中文,嘉兴做网站费用,中信建设有限责任公司阿尔及利亚我正在编写一个简单的应用程序#xff0c;它将大文本文件拆分为较小的文件#xff0c;并且我已经编写了2个版本#xff0c;一个使用列表#xff0c;另一个使用生成器。我使用memory_profiler模块对这两个版本进行了概要分析#xff0c;并清楚地显示了生成器版本的更好的内…我正在编写一个简单的应用程序它将大文本文件拆分为较小的文件并且我已经编写了2个版本一个使用列表另一个使用生成器。我使用memory_profiler模块对这两个版本进行了概要分析并清楚地显示了生成器版本的更好的内存效率但是在对使用生成器的版本进行概要分析时这很奇怪这增加了执行时间。下面的演示解释了我的意思 使用列表版本 frommemory_profilerimportprofileprofile()defmain():file_nameinput(Enter the full path of file you want to split into smaller inputFiles: )input_fileopen(file_name).readlines()num_lines_origlen(input_file)partsint(input(Enter the number of parts you want to split in: ))output_files[(file_namestr(i))foriinrange(1,parts1)]st0pint(num_lines_orig/parts)edpforiinrange(parts-1):withopen(output_files[i],w)asOF:OF.writelines(input_file[st:ed])sted edstpwithopen(output_files[-1],w)asOF:OF.writelines(input_file[st:])if__name____main__:main() 与分析器一起运行时 $ time py36Splitting\ text\ files_BAD_usingLists.pyEnterthe full path of file you want to split into smaller inputFiles:/apps/nttech/rbhanot/Downloads/test.txtEnterthe number of parts you want to splitin:3Filename:Splittingtext files_BAD_usingLists.pyLine# Mem usage Increment Line Contents647.8MiB0.0MiBprofile()7defmain():847.8MiB0.0MiBfile_nameinput(Enter the full path of file you want to split into smaller inputFiles: )9107.3MiB59.5MiBinput_fileopen(file_name).readlines()10107.3MiB0.0MiBnum_lines_origlen(input_file)11107.3MiB0.0MiBpartsint(input(Enter the number of parts you want to split in: ))12107.3MiB0.0MiBoutput_files[(file_namestr(i))foriinrange(1,parts1)]13107.3MiB0.0MiBst014107.3MiB0.0MiBpint(num_lines_orig/parts)15107.3MiB0.0MiBedp16108.1MiB0.7MiBforiinrange(parts-1):17107.6MiB-0.5MiBwithopen(output_files[i],w)asOF:18108.1MiB0.5MiBOF.writelines(input_file[st:ed])19108.1MiB0.0MiBsted20108.1MiB0.0MiBedstp2122108.1MiB0.0MiBwithopen(output_files[-1],w)asOF:23108.1MiB0.0MiBOF.writelines(input_file[st:])real0m6.115suser0m0.764ssys0m0.052s 在没有分析器的情况下运行 $ time py36Splitting\ text\ files_BAD_usingLists.pyEnterthe full path of file you want to split into smaller inputFiles:/apps/nttech/rbhanot/Downloads/test.txtEnterthe number of parts you want to splitin:3real0m5.916suser0m0.696ssys0m0.080s 现在使用发电机 profile()defmain():file_nameinput(Enter the full path of file you want to split into smaller inputFiles: )input_fileopen(file_name)num_lines_origsum(1for_ininput_file)input_file.seek(0)partsint(input(Enter the number of parts you want to split in: ))output_files((file_namestr(i))foriinrange(1,parts1))st0pint(num_lines_orig/parts)edpforiinrange(parts-1):filenext(output_files)withopen(file,w)asOF:for_inrange(st,ed):OF.writelines(input_file.readline())sted edstpifnum_lines_orig-ed filenext(output_files)withopen(file,w)asOF:for_inrange(st,ed):OF.writelines(input_file.readline())if__name____main__:main() 使用分析器选项运行时 $ time py36-m memory_profilerSplitting\ text\ files_GOOD_usingGenerators.pyEnterthe full path of file you want to split into smaller inputFiles:/apps/nttech/rbhanot/Downloads/test.txtEnterthe number of parts you want to splitin:3Filename:Splittingtext files_GOOD_usingGenerators.pyLine# Mem usage Increment Line Contents447.988MiB0.000MiBprofile()5defmain():647.988MiB0.000MiBfile_nameinput(Enter the full path of file you want to split into smaller inputFiles: )747.988MiB0.000MiBinput_fileopen(file_name)847.988MiB0.000MiBnum_lines_origsum(1for_ininput_file)947.988MiB0.000MiBinput_file.seek(0)1047.988MiB0.000MiBpartsint(input(Enter the number of parts you want to split in: ))1148.703MiB0.715MiBoutput_files((file_namestr(i))foriinrange(1,parts1))1247.988MiB-0.715MiBst01347.988MiB0.000MiBpint(num_lines_orig/parts)1447.988MiB0.000MiBedp1548.703MiB0.715MiBforiinrange(parts-1):1648.703MiB0.000MiBfilenext(output_files)1748.703MiB0.000MiBwithopen(file,w)asOF:1848.703MiB0.000MiBfor_inrange(st,ed):1948.703MiB0.000MiBOF.writelines(input_file.readline())202148.703MiB0.000MiBsted2248.703MiB0.000MiBedstp2348.703MiB0.000MiBifnum_lines_orig-ed
http://www.yutouwan.com/news/25562/

相关文章:

  • 平顶山河南网站建设wordpress 网校插件
  • 张家界城乡建设网站广州市黄埔区建设局网站
  • 衡阳市建设局网站淄博网络宣传
  • 上海网站建设 普送vi设计公司排行榜
  • 阳逻开发区网站建设中企动力可以在线做c语言的网站
  • 什么是理财北京网站建设公司邯郸市人社局
  • 外贸seo网站建设共享办公都有哪些公司
  • 长春专业企业网站建设工作室网站代运营公司有哪些
  • 2015百度竞价单页面网站模板源码设计室内设计联盟网页版
  • 免费ps模板下载网站建立网站需要注意事项
  • 深圳网站页面设计公司网络服务遇到问题请检查网络状况或稍后再试吧
  • 一_建设网站前的市场分析网页制作考试题及答案
  • 正规网站建设平台做网站赚钱么
  • 门户网站开发过程视频淘宝客cms建站教程
  • h5个人网站模板源码西安建设工程信息网人员查询
  • 网站制作建设公司房地产新闻app哪个好
  • 制作一个网站需要多久网站如何提交给百度
  • 青岛城市建设投资建设集团网站wordpress带会员中心
  • 网站的背景图怎么做做前端常用的网站及软件下载
  • 做三个月网站 广告收入广州市网站搭建制作
  • 网站的网站建设公司哪家好网站怎么做备案变更
  • 专业集团门户网站建设费用百度怎么发自己的广告
  • 做网站推广怎么找客户wordpress修改站点地址
  • 江苏省交通厅门户网站建设管理企业网站功能间联系
  • 全国知名网站wordpress开发api接口
  • 木屋网站建设网络优化有前途吗
  • html5企业网站厦门商城网站建设
  • 个人在国外网站做电商小程序软件开发
  • 海报设计网站官网做网站用虚拟主机还是用服务器
  • 网站1g空间多大想找可以在家做的手工活去什么网站