How to know if a popen*() was successful?

Fernando Pérez fperez528 at yahoo.com
Tue May 21 23:15:27 EDT 2002


Jeremy Bowers wrote:

>> Very good point. I'll probably rewrite my page() routine to simply jump out
>> straight to the dumb default under windows, and in Unix to do some
>> platform-specific tests which may work better (like using which to find the
>> person's pager).
> 
> Another possibility is using Tk or something to pop up your own pager,
> since Windows effectively doesn't have one worth a toot. (Though you
> might consider writing a temp file and calling up "notepad" or "wordpad"
> on it, if that works for you.) It's a pretty simple invocation of a
> scrolled text area, a couple of quick calls to fill it with text, and
> make it read-only, and viola, a simple, effective pager.

Thanks for the tips, I really appreciate it. But:

 - under unix, pagers (esp. less) work beautifully and fast, and can even 
display syntax highlighted code straight in. So I prefer a fast, efficient 
pager with builtin regexp searching over some tk solution which will require 
the user to use a mouse (I haven't seen anything in tk with the keyboard 
power of less for searching/navigation). Any command line tool which forces 
you to go to the mouse for basic functionality is IMHO broken.

 - this is done in my spare time, so I'll maintain windows as long as it 
remains a near zero-effort proposition. I'm not going to put any windows 
specific code beyond 'if I'm in windows, use builtin pure python defaults'. I 
simply can't test windows code much, I boot into it once in a blue moon.

Cheers,

f.



More information about the Python-list mailing list