Re: Compile python extensions under windows/cygwin

2009-05-24 Thread brendan . johnston
On May 25, 9:42 am, David Lyon wrote: > On Sun, 24 May 2009 15:34:42 -0700 (PDT), Joana > wrote: > > > I mantain Python on Windows, all installed packages are under c: > > \Python25\Lib\site-packages. Now I have to build C libraries used by > > python extensions and I am using cygwin, but I don't

portable way to tell what Popen will call

2008-05-13 Thread Brendan Miller
what Popen will work on without actually execute it? Do I have to write a bunch of platform specific code here? Thanks, Brendan -- http://mail.python.org/mailman/listinfo/python-list

portable fork+exec/spawn

2008-05-01 Thread Brendan Miller
ng in portable abstractions over system services. Brendan -- http://mail.python.org/mailman/listinfo/python-list

Re: portable fork+exec/spawn

2008-05-01 Thread Brendan Miller
On Fri, 02 May 2008 13:25:55 +1000, Ben Finney wrote: > URL:http://docs.python.org/lib/module-subprocess.html Awesome. This is exactly what I was hoping existed. -- http://mail.python.org/mailman/listinfo/python-list

portable /dev/null

2008-05-02 Thread Brendan Miller
passed to non python code. Is there a portable /dev/null somewhere in the standard library? Thanks, Brendan -- http://mail.python.org/mailman/listinfo/python-list

Re: portable /dev/null

2008-05-02 Thread Brendan Miller
On Fri, 02 May 2008 21:41:36 +0200, Christian Heimes wrote: > Brendan Miller schrieb: >> Hi, >> >> I have functions that take a file object and write to it. In some cases I >> just want to throw out what is written to that file object. I want >> something

iterators and views of lists

2009-12-15 Thread Brendan Miller
sn't really handle forward and bidirectional iterators... which I guess would be good for algorithms that operator over disk base datastructures... Anyone else had similar thoughts? Brendan -- http://mail.python.org/mailman/listinfo/python-list

Re: iterators and views of lists

2009-12-15 Thread Brendan Miller
On Tue, Dec 15, 2009 at 9:09 PM, Terry Reedy wrote: > On 12/15/2009 10:39 PM, Brendan Miller wrote: >> I'm wondering if anyone has done work towards creating more powerful >> iterators for python, or creating some more pythonic equivalent. > > For sequences, integer i

Re: iterators and views of lists

2009-12-16 Thread Brendan Miller
On Wed, Dec 16, 2009 at 4:16 AM, Paul Rudin wrote: > Steven D'Aprano writes: > > >> I'm sympathetic to your request for list views. I've often wanted some >> way to cleanly and neatly do this: >> >> for item in seq[1:]: >>     process(item) >> >> without making an unnecessary copy of almost all o

Re: iterators and views of lists

2009-12-16 Thread Brendan Miller
On Wed, Dec 16, 2009 at 12:38 PM, Anh Hai Trinh wrote: > On Dec 16, 2:48 pm, Brendan Miller wrote: > >> No, that's what I'm getting at... Most of the existing mutating >> algorithms in python (sort, reverse) operate over entire collections, >> not partia

Re: iterators and views of lists

2009-12-17 Thread Brendan Miller
On Thu, Dec 17, 2009 at 8:41 AM, Anh Hai Trinh wrote: >> I have a couple of thoughts: >> 1. Since [:] by convention already creates a copy, it might violate >> people's expectations if that syntax were used. > > Indeed, listagent returns self on __getitem__[:]. What I meant was > this: > >  x = [0

Re: iterators and views of lists

2009-12-17 Thread Brendan Miller
On Thu, Dec 17, 2009 at 6:44 PM, Steven D'Aprano wrote: > On Thu, 17 Dec 2009 12:07:59 -0800, Brendan Miller wrote: > >> I was thinking it would be cool to make python more usable in >> programming competitions by giving it its own port of the STL's >> algori

Re: iterators and views of lists

2009-12-18 Thread Brendan Miller
On Fri, Dec 18, 2009 at 10:39 AM, Carl Banks wrote: > On Dec 17, 10:00 pm, Brendan Miller wrote: >> On Thu, Dec 17, 2009 at 6:44 PM, Steven D'Aprano >> >> wrote: >> > On Thu, 17 Dec 2009 12:07:59 -0800, Brendan Miller wrote: >> >> >> I was th

Re: iterators and views of lists

2009-12-18 Thread Brendan Miller
On Fri, Dec 18, 2009 at 2:47 PM, Bearophile wrote: > Brendan Miller: >> I agree though, it doesn't matter to everyone and anyone. The reason I >> was interested was because i was trying to solve some specific >> problems in an elegant way. I was thinking it would be c

r"string" vs R"string

2010-01-16 Thread Brendan Miller
Is there any difference whatsoever between a raw string beginning with the captical R or one with the lower case r e.g. r"string" vs R"string"? -- http://mail.python.org/mailman/listinfo/python-list

order that destructors get called?

2010-04-07 Thread Brendan Miller
re's any documented order that reference counts get decremented when a module is released or when a program terminates. What I would expect is "reverse order of definition" but obviously that's not the case. Brendan -- http://mail.python.org/mailman/listinfo/python-list

Re: order that destructors get called?

2010-04-08 Thread Brendan Miller
a circular reference, so that the __del__ shouldn't be an issue. Brendan -- http://mail.python.org/mailman/listinfo/python-list

ctypes question

2010-04-14 Thread Brendan Miller
an integer argument? I didn't see this behavior documented when I read through http://docs.python.org/library/ctypes.html, maybe I'm just missing it... if that's the case a reference would be appreciated. Brendan -- http://mail.python.org/mailman/listinfo/python-list

Re: ctypes question

2010-04-15 Thread Brendan Miller
On Wed, Apr 14, 2010 at 12:12 PM, Mark Dickinson wrote: > On Apr 14, 7:09 pm, Brendan Miller wrote: >> I'm using python 2.5.2. >> >> I have a ctypes function with argtypes like this: >> >> _create_folder.argyptes = [c_void_p, c_int] > > Is that

gnu readline licensing?

2010-04-20 Thread Brendan Miller
Python provides a GNU readline interface... since readline is a GPLv3 library, doesn't that make python subject to the GPL? I'm confused because I thought python had a more BSD style license. Also, I presume programs written with the readline interface would still be subject to GPL... might want t

Re: gnu readline licensing?

2010-04-20 Thread Brendan Miller
On Tue, Apr 20, 2010 at 11:38 AM, Robert Kern wrote: > On 4/20/10 1:09 PM, Brendan Miller wrote: >> >> Python provides a GNU readline interface... since readline is a GPLv3 >> library, doesn't that make python subject to the GPL? I'm confused >> because

ctypes errcheck question

2010-04-21 Thread Brendan Miller
from errcheck. Thanks, Brendan -- http://mail.python.org/mailman/listinfo/python-list

ctypes: delay conversion from c_char_p to string

2010-04-21 Thread Brendan Miller
e the string itself after the copy... which I doubt. Is there some way to tell ctypes to return an actual c_char_p, or is my best bet to return a c_void_p and cast to c_char_p when I'm reading to convert to a string? Thanks Brendan -- http://mail.python.org/mailman/listinfo/python-list

Re: ctypes: delay conversion from c_char_p to string

2010-04-21 Thread Brendan Miller
p_val On Wed, Apr 21, 2010 at 3:15 PM, Brendan Miller wrote: > I have a function exposed through ctypes that returns a c_char_p. > Since I need to deallocate that c_char_p, it's inconvenient that > ctypes copies the c_char_p into a string instead of giving me the raw > pointe

Re: ctypes: delay conversion from c_char_p to string

2010-04-22 Thread Brendan Miller
On Thu, Apr 22, 2010 at 7:49 AM, Zvezdan Petkovic wrote: > > On Apr 21, 2010, at 6:29 PM, Brendan Miller wrote: > >> Here's the method I was using. Note that tmp_char_ptr is of type >> c_void_p. This should avoid the memory leak, assuming I am >> interpreting the

Re: assigning multi-line strings to variables

2010-04-27 Thread Brendan Abel
On Apr 27, 7:20 pm, goldtech wrote: > Hi, > > This is undoubtedly a newbie question. How doI assign variables > multiline strings? If I try this i get what's cited below. Thanks. > > >>> d="d > d" > >>> d > > Traceback (most recent call last): >   File "", line 1, in > NameError: name 'd'

Re: function name

2010-04-28 Thread Brendan Abel
On Apr 28, 11:44 am, Richard Lamboj wrote: > Hello, > > is there any way to get the name from the actual called function, so that the > function knows its own name? > > Kind Regards, > > Richi If you want to get the function name from within the function itself, check out the inspect module. http

Re: Python dot-equals (syntax proposal)

2010-04-30 Thread Brendan Abel
On Apr 30, 9:04 am, Jabapyth wrote: > At least a few times a day I wish python had the following shortcut > syntax: > > vbl.=func(args) > > this would be equivalent to > > vbl = vbl.func(args) > > example: > > foo = "Hello world" > foo.=split(" ") > print foo > # ['Hello', 'world'] > > and I guess

Re: Picking a license

2010-05-13 Thread Brendan Abel
While I think most of the disagreement in this long thread results from different beliefs in what "freedom" means, I wanted to add, that most of the responses that argue that the MIT license permits the user more freedom than the GPL, suffer from the broken window fallacy. This fallacy results from

starting repl programmatically

2010-05-20 Thread Brendan Miller
I have a python script that sets up some environmental stuff. I would then like to be able to change back to interactive mode and use that environment. What's the best way to do that? -- http://mail.python.org/mailman/listinfo/python-list

Re: starting repl programmatically

2010-05-20 Thread Brendan Miller
python -i myscript.py almost does what I want. The only problem is if I exit with exit(0) it does *not* enter interactive mode. I have to run off the end of the script as near as I can tell. Is there another way to exit without breaking python -i? On Thu, May 20, 2010 at 4:57 PM, Brendan Miller

Re: The real problem with Python 3 - no business case for conversion (was "I strongly dislike Python 3")

2010-07-07 Thread Brendan Abel
> > > One thing that would be very useful is how to maintain something that > > > works on 2.x and 3.x, but not limiting yourself to 2.6. Giving up > > > versions below 2.6 is out of the question for most projects with a > > > significant userbase IMHO. As such, the idea of running the python 3 > >

Re: The real problem with Python 3 - no business case for conversion (was "I strongly dislike Python 3")

2010-07-07 Thread Brendan Abel
On Jul 7, 3:00 pm, MRAB wrote: > Brendan Abel wrote: > >>>> One thing that would be very useful is how to maintain something that > >>>> works on 2.x and 3.x, but not limiting yourself to 2.6. Giving up > >>>> versions below 2.6 is out of the ques

utf-8 and ctypes

2010-09-28 Thread Brendan Miller
n the ascii subset of UTF-8 are discarded by c_char_p during the conversion, or at least they don't print out when I go to print the string. Does python not support utf-8 strings? Is there some other way I should be doing the conversion? Thanks, Brendan -- http://mail.python.org/mailman/listi

Re: utf-8 and ctypes

2010-09-29 Thread Brendan Miller
2010/9/29 Lawrence D'Oliveiro : > In message , Brendan > Miller wrote: > >> It seems that characters not in the ascii subset of UTF-8 are >> discarded by c_char_p during the conversion ... > > Not a chance. > >> ... or at least they don't print out

Python benefits over Cobra

2011-04-05 Thread Brendan Simon (eTRIX)
be less significant over time. I'm not sure about the .NET/Mono framework, whether that is good or bad. Sounds good in some situations at least. Any other arguments where Python has benefits over Cobra ?? Cheers, Brendan. -- http://mail.python.org/mailman/listinfo/python-list

Python3 "designed right" (was: PYTHONPATH)

2011-04-18 Thread Brendan Simon (eTRIX)
(or Mono), though the web pages do suggest they are also working on a version that runs on JVM. Also third party libraries (e.g GUIs like wx) may not be as good or available (yet) ?? http://cobra-language.com/docs/python/ http://cobra-language.com/docs/why/ -- Brendan. -- http://mail.python.org/mailman/listinfo/python-list

Re: [ANN] Python 2.5.6 Release Candidate 1

2011-04-18 Thread Brendan Simon (eTRIX)
not quite like that. I'd like to upgrade to 2.5.6 (for one particular mature application), but unfortunately I'm stuck with 2.5.4 as I don't really want to have to build (and hopefully get it right) on my OS X box. Cheers, Brendan. -- http://mail.python.org/mailman/listinfo/python-list

Re: Abandoning Python

2011-05-22 Thread Brendan Simon (eTRIX)
few improved things (eg. no "self", no ":", ...) Possible negatives are: * Requires either .NET or Mono frameworks. * lack of 3rd party libraries ?? Cheers, Brendan. -- http://mail.python.org/mailman/listinfo/python-list

Help using Thread (or other method)

2016-02-08 Thread Brendan Simon (eTRIX)
Is there a better way of structuring this to ensure I process the interrupt and not get interrupt overrun? Is using select only in the mainloop, with multiple file descriptors, a better way of doing things, so that I can process the file descriptor of interest first, before any others if set?

Re: WxPython versus Tkinter.

2011-01-26 Thread Brendan Simon (eTRIX)
Since it seems the python motto is "Batteries included", then it would seem to me that wxPython is the natural fit as it also has "Batteries included" (e.g. accessibility, native look-n-feel, mature and evolving, can produce simple or complex gui programs, etc, etc)

Re: wxPython in the context of Eclipse

2011-02-20 Thread Brendan Simon (eTRIX)
already done). If I recall correctly, I had to specify the python interpreter to use. It added a whole lot of paths to the PYTHONPATH variable which caused me some grief. I ended up removing them all (or most of them) and it worked fine after that. Cheers, Brendan. -- Brendan Simon

Can't find elements using ElementTree find method

2010-08-31 Thread Brendan Simon (eTRIX)
und ok :) comp = root.find( './/component' ) name = root.find( './/name' ) print 'comps =', comps print 'comp =', comp print 'name =', name Thanks, Brendan. -- http://mail.python.org/mailman/listinfo/python-list

Re: Can't find elements using ElementTree find method

2010-08-31 Thread Brendan Simon (eTRIX)
, then search for './component', './component/name' and so on. It's a bit ugly, but heaps better than using minidom :) Cheers, Brendan. On 31/08/10 6:57 PM, Nitin Pawar wrote: > Try using getroot() > > I think your root is components so its searching in root

Re: [Python-list] if the else short form

2010-09-29 Thread Brendan Simon (eTRIX)
utton = gtk.Button(label) or possibly: label = 'True' if fill else 'False' button = gtk.Button(label) or using a dict for label lookup: label = { True : 'True', False : 'False' } button = gtk.Button(label[fill]) Cheers, Brendan. -- http://mail.python.org/mailman/listinfo/python-list

Re: Whining about "struct"

2010-10-14 Thread Brendan Simon (eTRIX)
On 14/10/10 5:17 PM, python-list-requ...@python.org wrote: > Subject: > Whining about "struct" > From: > Tim Roberts > Date: > Wed, 13 Oct 2010 21:30:38 -0700 > > To: > python-list@python.org > > > I have a bad memory. I admit it. Because of that, the Python "help" > system is invaluable to me.

<    1   2