Re: On Java's Interface (the meaning of interface in computer programing)

2007-03-21 Thread Dr. Who
Don't Feed The Trolls :-) -- http://mail.python.org/mailman/listinfo/python-list

File locking

2007-03-12 Thread Dr. Who
I'm always disappointed when I find something that Python doesn't handle in a platform independent way. It seems to me that file locking is in that boat. 1. I don't see a way to atomically open a file for writing if and only if it doesn't exist without resorting to os.open and specialized platfor

Re: What about this?

2007-01-12 Thread Dr. Who
What's more amazing is that anyone would click on the link at all given the increasing number of website that provide hidden content that tries to deliver spyware or viruses just by getting visitors. Jeff Bjoern Schliessmann wrote: > new wrote: > > > www.magicoz.com > > amazing > > Yeah, it *is*

Re: Is Welfare Part of Capitalism?

2006-05-10 Thread Dr. Who
Technically, I would call it a manfesto. The manifesto module is probably the most facinating module in Python since it's the only one whose functions consist entirely of doc strings followed by a pass and do no useful work. Jeff Tim Daneliuk wrote: > [EMAIL PROTECTED] wrote: > > This article is

Re: Python Doc Error: os.makedirs

2005-10-19 Thread Dr. Who
Xah Lee wrote: > i think the function shouldn't complain if dir already exists. How is a > programer to distinguish if the dir already exists, or if there's a > problem creating the dir? Of course it should thrown an exception because it was unable to do what it was asked: create a directory. Th

Problem building Python on HP-UX

2005-09-02 Thread Dr. Who
I'm trying to build Python 2.4.1 on HP-UX 11.00 with full tcl/tk IDLE support. So far, I haven't had any luck. I always wind up getting errors of the form: ld: DP relative code in file /ptg/devtools/hppa1.1/pre/lib/libtk8.4.a(tkWindow.o) - shared library must be position independent. Use +z or

HTML/text formatting question

2005-08-03 Thread Dr. Who
I have a tool that outputs data in either html or text output. Currently I'm writing chucnks like: if html: print '' print '' print '' print 'Differences %s: %s' % (htypestr, lbl1) if html: ... This seems clunky and my next step was going to be to define generic functions whi

Re: On fighting fire with fire...

2005-07-29 Thread Dr. Who
I was explaining the difference between irony and sarcasm to my daughter just the other day. It was nice of Asad to provide us with such a besutiful example. Not that I'm sure that was his intent... Jeff -- http://mail.python.org/mailman/listinfo/python-list

Re: Something that Perl can do that Python can't?

2005-07-22 Thread Dr. Who
Well, I finally managed to solve it myself by looking at some code. The solution in Python is a little non-intuitive but this is how to get it: while 1: line = stdout.readline() if not line: break print 'LINE:', line, If anyone can do it the more Pythonic way with some sort of

Something that Perl can do that Python can't?

2005-07-22 Thread Dr. Who
So here it is: handle unbuffered output from a child process. Here is the child process script (bufcallee.py): import time print 'START' time.sleep(10) print 'STOP' In Perl, I do: open(FILE, "python bufcallee.py |"); while ($line = ) {

Re: Buffering problem using subprocess module

2005-07-21 Thread Dr. Who
Unfortunatley that doesn't help. Even when callee is started using the -u, I get the same behavior. -- http://mail.python.org/mailman/listinfo/python-list

Buffering problem using subprocess module

2005-07-21 Thread Dr. Who
I am using the subprocess module in 2.4. Here's the fragment: bufcaller.py: import sys, subprocess proc = subprocess.Popen('python bufcallee.py', bufsize=0, shell=True, stdout=subprocess.PIPE) for line in proc.stdout: sys.stdout.write(line) bufcallee.py: