• <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按给定顺序将多个文件附加到一个大文件中

        时间:2023-09-28
      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按给定顺序将多个文件附加到一个大文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:df.append() 未附加到 DataFrame 下一篇:python中用于列表操作的plus和append有什么区别?

                  相关文章

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

                2. <tfoot id='iJjiD'></tfoot>

                  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>