Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'win32': 0.03; 'subject:file': 0.07; 'creation,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'to)': 0.09; 'subject:How': 0.10; 'python': 0.11; 'jan': 0.12; '"in': 0.16; '5:30': 0.16; 'created.': 0.16; 'initially,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'saved.': 0.16; 'wrote:': 0.18; '(not': 0.18; 'thu,': 0.19; 'solution.': 0.20; 'creating': 0.23; 'header:User-Agent:1': 0.23; 'replace': 0.24; 'looks': 0.24; "i've": 0.25; 'task': 0.26; 'header:X-Complaints- To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'url:mailman': 0.30; 'occurs': 0.31; 'file': 0.32; 'url:python': 0.33; 'running': 0.33; '(e.g.': 0.33; 'subject:the': 0.34; 'could': 0.34; 'problem': 0.35; 'but': 0.35; 'disk': 0.36; 'url:listinfo': 0.36; 'method': 0.36; 'subject:?': 0.36; 'url:org': 0.36; 'should': 0.36; 'being': 0.38; 'to:addr:python- list': 0.38; 'pm,': 0.38; 'previous': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'according': 0.40; 'url:mail': 0.40; 'save': 0.62; 'more': 0.64; '30,': 0.65; 'obvious': 0.74; 'you:': 0.81; '3.4': 0.84; 'received:fios.verizon.net': 0.84; 'joel': 0.91; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Saving a file "in the background" -- How? Date: Thu, 30 Oct 2014 22:00:30 -0400 References: <5452ADFD.5030801@it.uu.se> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-108-16-203-145.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1414720852 news.xs4all.nl 2911 [2001:888:2000:d::a6]:55200 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:79988 On 10/30/2014 6:21 PM, Joel Goldstick wrote: > On Thu, Oct 30, 2014 at 5:30 PM, Virgil Stokes wrote: >> While running a python program I need to save some of the data that is being >> created. I would like to save the data to a file on a disk according to a >> periodical schedule (e.g. every 10 minutes). Initially, the amount of data >> is small (< 1 MB) but after sometime the amount of data can be >10MB. If a >> problem occurs during data creation, then the user should be able to start >> over from the last successfully saved data. >> >> For my particular application, no other file is being saved and the data >> should always replace (not be appended to) the previous data saved. It is >> important that the data be saved without any obvious distraction to the >> user who is busy creating more data. That is, I would like to save the data >> "in the background". >> >> What is a good method to perform this task using Python 2.7.8 on a Win32 >> platform? >> -- >> https://mail.python.org/mailman/listinfo/python-list > > I've not tried this, but stackoverflow has a solution that looks like > it could work for you: > http://stackoverflow.com/questions/16214736/write-data-to-disk-in-python-as-a-background-process Python 3.4 should have an asyncio solution. -- Terry Jan Reedy