Don't Feed The Trolls :-)
--
http://mail.python.org/mailman/listinfo/python-list
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
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*
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
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
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
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
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
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
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 = )
{
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
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:
12 matches
Mail list logo