Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed2.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'output': 0.05; 'subject:would': 0.07; 'arguments': 0.09; 'blue': 0.09; 'parsing': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'url:github': 0.09; 'window.': 0.09; 'windows,': 0.09; 'runs': 0.10; 'python': 0.11; 'gui': 0.12; 'jan': 0.12; 'wrote': 0.14; 'anyway': 0.14; 'windows': 0.15; '(default': 0.16; '.py': 0.16; 'advice:': 0.16; 'exceptions,': 0.16; 'idle,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'subject: \n ': 0.16; 'think.': 0.16; 'ui,': 0.16; 'wrote:': 0.18; 'file,': 0.19; 'thu,': 0.19; 'command': 0.22; 'input': 0.22; 'shell': 0.22; 'load': 0.23; 'header:User-Agent:1': 0.23; 'typical': 0.24; "haven't": 0.24; 'script': 0.25; 'compare': 0.26; 'this:': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'chris': 0.29; 'am,': 0.29; 'subject:) ': 0.29; 'unix': 0.29; 'easier': 0.31; '(although': 0.31; 'os,': 0.31; 'prints': 0.31; 'subject:what': 0.31; 'file': 0.32; 'probably': 0.32; 'option': 0.32; 'run': 0.32; 'quite': 0.32; 'linux': 0.33; 'framework': 0.33; 'mac': 0.33; 'actual': 0.34; 'maybe': 0.34; 'something': 0.35; 'editor': 0.35; 'requirement': 0.35; 'but': 0.35; 'there': 0.35; 'idle': 0.36; 'interaction': 0.36; "didn't": 0.36; 'subject:?': 0.36; 'should': 0.36; 'christian': 0.38; 'massive': 0.38; 'saves': 0.38; 'window': 0.38; 'to:addr:python- list': 0.38; 'pm,': 0.38; 'bad': 0.39; 'received:71': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'easy': 0.60; 'simple,': 0.60; 'most': 0.60; 'hope': 0.61; 'black': 0.61; 'new': 0.61; 'first': 0.61; "you'll": 0.62; 'real': 0.63; 'more': 0.64; 'different': 0.65; 'series': 0.66; 'press': 0.70; 'ever.': 0.84; 'gone.': 0.84; 'received:fios.verizon.net': 0.84; 'seldom': 0.84; 'summer,': 0.84; 'url:master': 0.84; 'subject:much': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Under what kind of situation, time.sleep(n) would sleep much longer than n seconds? Date: Thu, 19 Jun 2014 22:33:54 -0400 References: <713f4189-5ffe-492d-9c7d-447bb4b4928a@googlegroups.com> <4d7c474a-b88e-4dea-b74c-ed34f4969310@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-71-175-90-87.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: 48 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1403231653 news.xs4all.nl 2881 [2001:888:2000:d::a6]:54869 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:73443 On 6/19/2014 3:42 AM, Chris Angelico wrote: > On Thu, Jun 19, 2014 at 5:18 PM, Christian Gollwitzer wrote: >> My advice: >> >> 1) First try parsing the command line. (Example: All Unix tools) >> >> 2) If you require more interaction and maybe state preservation, just write >> a couple of functions and run it in IPython (Example: SciPy) >> >> 3) Use a real GUI framework >> >> It turns out, that 3) is actually not only easier to use, but often easier >> to write than 1) > > I disagree. It may not be the *best* console UI, but it's not as bad > as you think. Yes, what I wrote was a massive oversimplification, but > compare this: > > https://github.com/Rosuav/runningtime/blob/master/runningtime.py#L44 > > That's a simple, straight-forward UI. If you put the .py file onto > your desktop and double-click it, you'll see a series of prompts, and > this works on Windows, OS/2, probably Mac OS, and quite a few Linux > desktops. (Although I didn't put a shebang on that file, so it might > not work on your typical Linux.) How do you make something that > provides command line arguments to a double-clicked-on icon? Different > for every platform. (And seldom as easy as it is on OS/2.) If you run > that in a terminal, you'll see a series of prompts, and it works on > probably every Python implementation EVER. If you pull it up in IDLE, > it'll probably work there too, although I haven't tried it. Most any* console script runs fine** in Idle once you load it into the editor and press F5. Prompts and prints go the shell window (default blue on white) and input comes from the same (default black on white). * I said most because there must be exceptions, but have no characterization. ** Better than the windows console in some respects. I hope that by the end of the summer, the requirement to load in the editor will be gone. (Run F5 saves to a file anyway for actual execution.) There should also be an option to put output in a new window. -- Terry Jan Reedy