• <tfoot id='UJfBR'></tfoot>

  • <i id='UJfBR'><tr id='UJfBR'><dt id='UJfBR'><q id='UJfBR'><span id='UJfBR'><b id='UJfBR'><form id='UJfBR'><ins id='UJfBR'></ins><ul id='UJfBR'></ul><sub id='UJfBR'></sub></form><legend id='UJfBR'></legend><bdo id='UJfBR'><pre id='UJfBR'><center id='UJfBR'></center></pre></bdo></b><th id='UJfBR'></th></span></q></dt></tr></i><div id='UJfBR'><tfoot id='UJfBR'></tfoot><dl id='UJfBR'><fieldset id='UJfBR'></fieldset></dl></div>

    <small id='UJfBR'></small><noframes id='UJfBR'>

    • <bdo id='UJfBR'></bdo><ul id='UJfBR'></ul>

    1. <legend id='UJfBR'><style id='UJfBR'><dir id='UJfBR'><q id='UJfBR'></q></dir></style></legend>

        Python按给定顺序将多个文件附加到一个大文件中

        Python append multiple files in given order to one big file(Python按给定顺序将多个文件附加到一个大文件中)
      1. <i id='lcWt3'><tr id='lcWt3'><dt id='lcWt3'><q id='lcWt3'><span id='lcWt3'><b id='lcWt3'><form id='lcWt3'><ins id='lcWt3'></ins><ul id='lcWt3'></ul><sub id='lcWt3'></sub></form><legend id='lcWt3'></legend><bdo id='lcWt3'><pre id='lcWt3'><center id='lcWt3'></center></pre></bdo></b><th id='lcWt3'></th></span></q></dt></tr></i><div id='lcWt3'><tfoot id='lcWt3'></tfoot><dl id='lcWt3'><fieldset id='lcWt3'></fieldset></dl></div>

          <tbody id='lcWt3'></tbody>
        • <bdo id='lcWt3'></bdo><ul id='lcWt3'></ul>

            • <legend id='lcWt3'><style id='lcWt3'><dir id='lcWt3'><q id='lcWt3'></q></dir></style></legend>
              1. <tfoot id='lcWt3'></tfoot>

                  <small id='lcWt3'></small><noframes id='lcWt3'>

                1. 本文介绍了Python按给定顺序将多个文件附加到一个大文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有多达 8 个单独的 Python 进程在共享文件夹中创建临时文件.然后我希望控制过程以特定顺序将所有临时文件附加到一个大文件中.在与操作系统无关的 shell 级别上执行此操作的最快方法是什么?

                  I have up to 8 seperate Python processes creating temp files in a shared folder. Then I'd like the controlling process to append all the temp files in a certain order into one big file. What's the quickest way of doing this at an os agnostic shell level?

                  推荐答案

                  只使用简单的文件IO:

                  Just using simple file IO:

                  # tempfiles is a list of file handles to your temp files. Order them however you like
                  f = open("bigfile.txt", "w")
                  for tempfile in tempfiles:
                      f.write(tempfile.read())
                  

                  这与操作系统无关.它也相当简单,性能应该和使用其他任何东西一样好.

                  That's about as OS agnostic as it gets. It's also fairly simple, and the performance ought to be about as good as using anything else.

                  这篇关于Python按给定顺序将多个文件附加到一个大文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Adding config modes to Plotly.Py offline - modebar(将配置模式添加到 Plotly.Py 离线 - 模式栏)
                  Plotly: How to style a plotly figure so that it doesn#39;t display gaps for missing dates?(Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙?)
                  python save plotly plot to local file and insert into html(python将绘图保存到本地文件并插入到html中)
                  Plotly: What color cycle does plotly express follow?(情节:情节表达遵循什么颜色循环?)
                  How to save plotly express plot into a html or static image file?(如何将情节表达图保存到 html 或静态图像文件中?)
                  Plotly: How to make a line plot from a pandas dataframe with a long or wide format?(Plotly:如何使用长格式或宽格式的 pandas 数据框制作线图?)

                    <bdo id='iJjiD'></bdo><ul id='iJjiD'></ul>

                  • <tfoot id='iJjiD'></tfoot>

                          <tbody id='iJjiD'></tbody>

                      1. <small id='iJjiD'></small><noframes id='iJjiD'>

                        <i id='iJjiD'><tr id='iJjiD'><dt id='iJjiD'><q id='iJjiD'><span id='iJjiD'><b id='iJjiD'><form id='iJjiD'><ins id='iJjiD'></ins><ul id='iJjiD'></ul><sub id='iJjiD'></sub></form><legend id='iJjiD'></legend><bdo id='iJjiD'><pre id='iJjiD'><center id='iJjiD'></center></pre></bdo></b><th id='iJjiD'></th></span></q></dt></tr></i><div id='iJjiD'><tfoot id='iJjiD'></tfoot><dl id='iJjiD'><fieldset id='iJjiD'></fieldset></dl></div>

                          <legend id='iJjiD'><style id='iJjiD'><dir id='iJjiD'><q id='iJjiD'></q></dir></style></legend>