Under what kind of situation, time.sleep(n) would sleep much longer than n seconds?

Terry Reedy tjreedy at udel.edu
Thu Jun 19 22:33:54 EDT 2014


On 6/19/2014 3:42 AM, Chris Angelico wrote:
> On Thu, Jun 19, 2014 at 5:18 PM, Christian Gollwitzer <auriocus at gmx.de> 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




More information about the Python-list mailing list