Re: what happens to Popen()'s parent-side file descriptors?

2010-10-13 Thread Nobody
On Wed, 13 Oct 2010 14:58:57 -0700, Roger Davis wrote: > My understanding is that this functionality is best coded via > subprocess.Popen(). I need to read output from these spawned children > via a pipe from their stdout, hence something like > > p= subprocess.Popen(args, stdout=subprocess.

Re: what happens to Popen()'s parent-side file descriptors?

2010-10-14 Thread Nobody
On Thu, 14 Oct 2010 08:48:45 -0700, Roger Davis wrote: > On a related point here, I have one case where I need to replace the > shell construct > >externalprog otherfile > > I suppose I could just use os.system() here but I'd rather keep the > Unix shell completely out of the picture (which

Re: open() throws permission error and I don't get why

2010-10-15 Thread Nobody
eresting file system > locations. > > I've established, through logging, that postfix runs my script with UID > nobody & GID nobody. The directory I'm attempting to write has > permissions 0770. The directory's group is not nobody, but the user > nobody is a mem

Re: please help explain this result

2010-10-17 Thread Nobody
On Sun, 17 Oct 2010 03:58:21 -0700, Yingjie Lan wrote: > I played with an example related to namespaces/scoping. The result is a > little confusing: a=1 def f(): > a = a + 1 > return a > f() > UnboundLocalError: local variable 'a' referenced before assignment If you

Re: Classes in a class: how to access variables from one in another

2010-10-18 Thread Nobody
On Mon, 18 Oct 2010 14:35:58 +, fab wrote: > So my way of coding it is the following: > > class zone(GtkDrawingArea): > > class systemOfCoordinates: > self.xmin = -5 > self.xmax = 5 > self.ymin = -5 > self.ymax = 5 "self" isn't meaningful within a class definition. It's f

Re: Script to capture stderr of subprocess

2010-10-20 Thread Nobody
On Tue, 19 Oct 2010 11:21:49 -0700, [email protected] wrote: > Actually, if it was possible, it would be nice to capture all > the bytes going between stdin and stdout in a file as well for > debugging purposes. If the child process expects to be running on a terminal, you would need to use a ps

Re: Filename for stdout

2010-10-21 Thread Nobody
Richard Gibbs wrote: > If my python script is called with stdout (or stdin or stderr) > redirected to a file, how can I find the filename under Linux?  Under > Windows? On Linux, you can read the /proc/self/fd/* symlinks, e.g.: stdin_filename = os.readlink('/proc/self/fd/0') This isn't

Re: memory management - avoid swapping/paging

2010-10-21 Thread Nobody
On Thu, 21 Oct 2010 02:34:15 -0700, Jon Clements wrote: > I'm after something that says: "I want 512mb of physical RAM, I don't > want you to page/swap it, if you can't do that, don't bother at all". > Now I'm guessing, that an OS might be able to grant that, but later on > have to kill the proces

Re: python shell silently ignores termios.tcsetattr()

2010-10-21 Thread Nobody
On Wed, 20 Oct 2010 16:18:57 +, kj wrote: > I tried to fix the problem by applying the equivalent of "stty -echo" > within a python interactive session, but discovered that this setting is > immediately (and silently) overwritten. FWIW, I don't see this behaviour with Python 2.6.5 on Linux. I

Re: Unix-head needs to Windows-ize his Python script (II)

2010-10-26 Thread Nobody
On Tue, 26 Oct 2010 14:44:11 +, Grant Edwards wrote: >> There is no difference based on the name of your executable, how it >> is built, or what libraries it links to; the only difference is in >> its run-time behaviour, whether it invokes any GUI functions or not. > > No, we're not talking a

Re: Unix-head needs to Windows-ize his Python script (II)

2010-10-26 Thread Nobody
On Wed, 27 Oct 2010 13:46:28 +1300, Lawrence D'Oliveiro wrote: > Why would you want both CLI and GUI functions in one program? An obvious example was the one which was being discussed, i.e. the Python interpreter. Depending upon the "script", it may need to behave as a command-line utility (read

Re: Unix-head needs to Windows-ize his Python script (II)

2010-10-28 Thread Nobody
On Thu, 28 Oct 2010 12:54:03 +1300, Lawrence D'Oliveiro wrote: >>> Why would you want both CLI and GUI functions in one program? >> >> An obvious example was the one which was being discussed, i.e. the Python >> interpreter. > > But the Python interpreter has no GUI. It may have one if you use

Re: Silly newbie question - Carrot character (^)

2010-11-05 Thread Nobody
On Fri, 05 Nov 2010 10:12:05 -0400, Philip Semanchuk wrote: > As others have said, ^ is for XOR. That's buried here in the > documentation: > http://docs.python.org/release/2.7/reference/... > > Not that I would have expected you to find it there since that's pretty > dense. In fact, older versio

Re: *** glibc detected *** gdb: malloc(): smallbin double linked list

2010-11-05 Thread Nobody
On Fri, 05 Nov 2010 19:39:12 +, John Reid wrote: > I've compiled > Python 2.7 (r27:82500, Nov 2 2010, 09:00:37) [GCC 4.4.3] on linux2 > > with the following configure options > ./configure --prefix=/home/john/local/python-dbg --with-pydebug > > I've installed numpy and some other packages b

Re: Silly newbie question - Carrot character (^)

2010-11-06 Thread Nobody
On Fri, 05 Nov 2010 22:51:10 +, Seebs wrote: >> IMHO, the lack of a reference manual for the language itself is a major >> hole in Python's documentation. > > I'm a bit lost here. Could you highlight some of the differences between > "a reference manual for the language itself" and "somethin

Re: Silly newbie question - Carrot character (^)

2010-11-06 Thread Nobody
On Sun, 07 Nov 2010 00:06:25 +, Steven D'Aprano wrote: >> A reference manual tells you how to use the language. A specification >> tells you how to implement it. > > Surely a tutorial tells you *how* to use the language. I wouldn't expect > a reference manual to teach me how to run and edit

Re: http error 301 for urlopen

2010-11-07 Thread Nobody
On Sun, 07 Nov 2010 20:51:50 -0500, D'Arcy J.M. Cain wrote: >> urllib2.HTTPError: HTTP Error 301: The HTTP server returned a redirect error >> that would lead to an infinite loop. >> The last 30x error message was: >> Moved Permanently >> >> I can open the link in browser. Any way to get solve th

Re: Commercial or Famous Applicattions.?

2010-11-10 Thread Nobody
On Wed, 10 Nov 2010 13:07:58 +, Martin Gregorie wrote: > FWIW the thing that really irritated me about fetchmail is the way it > only deletes messages at the end of a session and never cleans up after > itself. If a session gets timed out or otherwise interrupted the messages > that were re

Re: multiple discontinued ranges

2010-11-10 Thread Nobody
On Wed, 10 Nov 2010 09:34:14 -0800, xoff wrote: > I am curious, why wouldn't you advise something like this: > for i in chain(range(3,7) + range(17,23)): Because it constructs all three lists (both of the individual ranges and their concatenation) in memory. For a trivial example, that isn't a pr

urllib.FancyURLopener.redirect_internal behavior

2009-06-03 Thread Nick Nobody
Hello, I've recently been playing around with urllib.FancyURLopener and noticed that under certain conditions it can block after calling open() on a url. It only happens on specific servers and when the "Range" HTTP header is in use. The server doesn't close the connection and redirect_intern

Re: spam <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>

2008-07-11 Thread Nobody Here
rickman <[EMAIL PROTECTED]> wrote: > spam No fucking shit, Sherlock, why double the volume by pointing out the obvious? -- http://mail.python.org/mailman/listinfo/python-list

<    3   4   5   6   7   8