Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'socket': 0.07; 'subject:would': 0.07; 'scripts,': 0.09; 'window.': 0.09; 'cc:addr :python-list': 0.11; 'python': 0.11; 'times,': 0.14; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'script,': 0.16; 'stuff,': 0.16; 'subject: \n ': 0.16; 'suggestion.': 0.16; 'ways:': 0.16; 'wxpython': 0.16; 'wrote:': 0.18; 'backend': 0.19; 'finished': 0.19; 'thu,': 0.19; 'work,': 0.20; 'cc:addr:python.org': 0.22; 'script.': 0.24; 'tend': 0.24; 'cc:2**0': 0.24; 'sort': 0.25; "i've": 0.25; 'script': 0.25; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'subject:) ': 0.29; 'related': 0.29; 'message-id:@mail.gmail.com': 0.30; 'usually': 0.31; 'pipe': 0.31; 'subject:what': 0.31; 'file': 0.32; 'linux': 0.33; 'received:google.com': 0.35; 'done': 0.36; 'thanks': 0.36; 'subject:?': 0.36; 'configured': 0.38; 'use.': 0.39; 'then,': 0.60; 'browser': 0.61; 'first': 0.61; 'show': 0.63; 'internet': 0.71; 'easier!': 0.84; 'everything.': 0.84; 'subject:much': 0.91; 'to:none': 0.92; 'picture': 0.97 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=MTzT66CLFiybAl+5dhAhAzSeMKfayd6SKM2Tj9CfkpY=; b=qaeH6he1Pmh224kIk7IwPxOAvBgN/RYQX4ATMSnuzTVuCz6PbiGmnzsmCRdGkdW89O As6c1fcdn7tdZ3MToTFyPHETZVFRXZZo0/D5UFJhDl1O3WD0WC8TG9p2u88T9wGC3w+C eK9E8O2aCmEJX2GuQErF/jLHOqZovrSYpjhUlsUY/X8RYlkHPemgIUhaUdyogUwbnubp Wcv+B/QQio55l5kThAVXExIPlSI8/dBgw9xNoz2aSHVSRsGGXEGzgpKlcFP0l76Jollq glvtsZGAqSlCIpmWZ0PI/NwTb1Uv7SD17L+OYktKUtsO/C6pa/jRLMsOGLPEhHgr6jqr 8BwA== MIME-Version: 1.0 X-Received: by 10.52.117.209 with SMTP id kg17mr1526055vdb.28.1403150336665; Wed, 18 Jun 2014 20:58:56 -0700 (PDT) In-Reply-To: <9d959182-ab76-4164-aeee-78fa0a38c7cd@googlegroups.com> References: <713f4189-5ffe-492d-9c7d-447bb4b4928a@googlegroups.com> <4d7c474a-b88e-4dea-b74c-ed34f4969310@googlegroups.com> <9d959182-ab76-4164-aeee-78fa0a38c7cd@googlegroups.com> Date: Thu, 19 Jun 2014 13:58:56 +1000 Subject: Re: Under what kind of situation, time.sleep(n) would sleep much longer than n seconds? From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1403150338 news.xs4all.nl 2899 [2001:888:2000:d::a6]:47317 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:73390 On Thu, Jun 19, 2014 at 11:41 AM, crow wrote: > Thanks for the suggestion. > For my script, I want to download a picture from internet & show it in a window, that's why I use wxPython. > > Well, I think I may can avoid sleep in wxPython in 2 ways: > 1. Use web.py, let python do backend work, let browser show me everything. As you suggested. I've done this one a few times, although on Linux I tend to just use gnome-open or xdg-open and let the file be displayed with whatever's configured - there's usually some sort of image viewer available on the systems I use. > 2. Write 2 scripts, one script do network related works, sleep at will; the other one show GUI. Use pipe or socket for process communication. 3. Write one script. First do the network stuff, sleep at will; then, when it's finished downloading, show the window. That might be easier! ChrisA