Re: Need some IPC pointers

2011-12-06 Thread Floris Bruynooghe
I'm surprised no one has mentioned zeromq as transport yet. It provides scaling from in proc (between threads) to inter-process and remote machines in a fairly transparent way. It's obviously not the python stdlib and as any system there are downsides too. Regards, Flori

Re: Condition.wait(timeout) oddities

2011-05-23 Thread Floris Bruynooghe
On Monday, 23 May 2011 17:32:19 UTC, Chris Torek wrote: > In article > <94d1d127-b423-4bd4...@glegroupsg2000goo.googlegroups.com> > Floris Bruynooghe wrote: > >I'm a little confused about the corner cases of Condition.wait() with a > >timeout parameter in t

Condition.wait(timeout) oddities

2011-05-23 Thread Floris Bruynooghe
e because when you get an exception you can break the promise of holding the lock. But maybe I'm missing something important or obvious, so I'd be happy to be enlightened! Regards Floris -- http://mail.python.org/mailman/listinfo/python-list

Re: Twisted and txJSON-RPC

2011-03-21 Thread Floris Bruynooghe
atests code from the VCS which contains all the required files. That's what I did anyway: brz branch lp:txjsonrpc Then just do your usual favourite incantation of "python setup.py install --magic-options-to-make-setuptools-sane-for-you". Regards Floris -- http://mail.python

Re: How to read source code of python?

2010-06-10 Thread Floris Bruynooghe
C-API (again in the docs) to be able to read it (even if you don't that's a pretty straightforward function to read). Hope that helps Floris -- http://mail.python.org/mailman/listinfo/python-list

Re: converting a timezone-less datetime to seconds since the epoch

2010-04-07 Thread Floris Bruynooghe
ne in finding this strange: http://bugs.python.org/issue6280 (the short apologetic reason is that timegm is written in python rather the C) Regards Floris -- http://mail.python.org/mailman/listinfo/python-list

Re: Queue peek?

2010-03-03 Thread Floris Bruynooghe
which could be argued as a better design in the first place. I was just wondering if other people ever missed the "q.put_at_front_of_queue()" method or if it is just me. Regards Floris PS: assuming "val = q.get()" on the first line -- http://mail.python.org/mailman/listinfo/python-list

Re: Ad hoc lists vs ad hoc tuples

2010-01-27 Thread Floris Bruynooghe
On Jan 27, 10:15 pm, Terry Reedy wrote: > On 1/27/2010 12:32 PM, Antoine Pitrou wrote: > > > Le Wed, 27 Jan 2010 02:20:53 -0800, Floris Bruynooghe a écrit : > > >> Is a list or tuple better or more efficient in these situations? > > > Tuples are faster to al

Ad hoc lists vs ad hoc tuples

2010-01-27 Thread Floris Bruynooghe
Is a list or tuple better or more efficient in these situations? Regards Floris PS: This is inspired by some of the space-efficiency comments from the list.pop(0) discussion. -- http://mail.python.org/mailman/listinfo/python-list

Re: question about subprocess and shells

2009-12-05 Thread Floris Bruynooghe
cess executed). Of course when I say "pipeline" it could also be a single command or a list or any valid shell. Regards Floris -- http://mail.python.org/mailman/listinfo/python-list

Re: Install script under a different name

2009-12-05 Thread Floris Bruynooghe
On Dec 5, 1:52 am, Lie Ryan wrote: > on linux/unix, you need to add the proper #! line to the top of any > executable scripts and of course set the executable bit permission > (chmod +x scriptname). In linux/unix there is no need to have the .py > extension for a file to be recognized as python sc

Re: Bored.

2009-12-01 Thread Floris Bruynooghe
On Nov 30, 11:52 pm, Stef Mientki wrote: > Well I thought that after 2 years you would know every detail of a > language ;-) Ouch, I must be especially stupid then! ;-) Floris -- http://mail.python.org/mailman/listinfo/python-list

Re: how to create a pip package

2009-11-10 Thread Floris Bruynooghe
tutils with many fancy things but if you don't need those (and that's what it sounds like) then sticking to distutils is better as you only require the python stdlib. Regards Floris -- http://mail.python.org/mailman/listinfo/python-list

Re: Best Way to Handle All Exceptions

2009-07-13 Thread Floris Bruynooghe
at. And I've haven't seen an external module in the wild that does that in years and the stdlib will always play nice. Regards Floris -- http://mail.python.org/mailman/listinfo/python-list

Re: Where does setuptools live?

2009-07-04 Thread Floris Bruynooghe
mail.python.org/pipermail/distutils-sig/2009-July/012374.html > It's seen no changes in 9 months. It's setuptools... I'm sure you can find many flamefests on distutils- sig about this. Regards Floris -- http://mail.python.org/mailman/listinfo/python-list

Re: multi-thread python interpreaters and c++ program

2009-06-10 Thread Floris Bruynooghe
it crashed. Your threads are daemonic, you could be seeing http://bugs.python.org/issue1856 You'll have to check your stack in a debugger to know. But as said this can be avoided by making the threads finish themself and joining them. Regards Floris -- http://mail.python.org/mailman/listinfo/python-list

Re: Python C API String Memory Consumption

2009-04-07 Thread Floris Bruynooghe
quot;the C allocator and the Python memory > manager ... implement different algorithms and operate on different > heaps""". > > > but it's better to > > stick with CPython's memory allocators when writing for CPython. > > for the reasons given in the la

Re: PEP 3143: Standard daemon process library

2009-03-24 Thread Floris Bruynooghe
On Mar 21, 11:06 pm, Ben Finney wrote: > Floris Bruynooghe writes: > > Had a quick look at the PEP and it looks very nice IMHO. > > Thank you. I hope you can try the implementation and report feedback > on that too. > > > One of the things that might be

Re: PEP 3143: Standard daemon process library (was: Writing a well-behaved daemon)

2009-03-20 Thread Floris Bruynooghe
be interesting is keeping file descriptors from the logging module open by default. So that you can setup your loggers before you daemonise --I do this so that I can complain on stdout if that gives trouble-- and are still able to use them once you've daemonised. I haven't looked at how feasable this is yet so it might be difficult, but useful anyway. Regards Floris -- http://mail.python.org/mailman/listinfo/python-list

Re: distutils compiler flags for extension modules

2009-03-20 Thread Floris Bruynooghe
(file:///usr/share/doc/python2.5/html/ dist/module-distutils.ccompiler.html#l2h-37) before calling build_ext.build_extension(). Regards Floris -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonic way to determine if a string is a number

2009-02-17 Thread Floris Bruynooghe
o developing this yourself from scratch seems dangerous, let it bubble down to libc which should handle it correctly. Regards Floris -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonic way to determine if a string is a number

2009-02-17 Thread Floris Bruynooghe
ions from Exception and not from StandardError. So maybe your catch-all should be Exception? In that case you would be catching warnings though, no idea what influence that has on the warning system. Regards Floris PS: Does anybody know why StopIterantion derrives from Exception while GeneratorExit

Re: memory recycling/garbage collecting problem

2009-02-17 Thread Floris Bruynooghe
processes back. There might be a way to force your OS to do so earlier manually if you really want but I'm not sure how you'd do that. Regards Floris -- http://mail.python.org/mailman/listinfo/python-list

Re: x64 speed

2009-02-04 Thread Floris Bruynooghe
t it prints the time of the tests. So it's only natural that the wall time Python prints on just the tests is going to be smaller then the wall time time prints for the entire python process. Same for when it starts, some stuff is done in Python before it starts its timer. Regards Floris -- http://mail.python.org/mailman/listinfo/python-list

Overriding base class methods in the C API

2009-01-18 Thread Floris Bruynooghe
Hello I've been trying to figure out how to override methods of a class in the C API. For Python code you can just redefine the method in your subclass, but setting tp_methods on the type object does not seem to have any influcence. Anyone know of a trick I am missing? Cheers Floris --

Re: Using exceptions in defined in an extension module inside another extension module

2008-12-24 Thread Floris Bruynooghe
Christian Heimes wrote: > Floris Bruynooghe schrieb: > > What I can't work out however is how to then be able to raise this > > exception in another extension module. Just defining it as "extern" > > doesn't work, even if I make sure the first mod

Using exceptions in defined in an extension module inside another extension module

2008-12-24 Thread Floris Bruynooghe
first. Because the symbol is defined in the first extension module the dynamic linker can't find it as it only seems to look in the main python executable for symbols used in dlloaded sofiles. Does anyone have an idea of how you can do this? Thanks Floris -- http://mail.python.org/mailman/listinfo/python-list

Re: C API and memory allocation

2008-12-18 Thread Floris Bruynooghe
On Dec 18, 6:43 am, Stefan Behnel wrote: > Floris Bruynooghe wrote: > > I'm slightly confused about some memory allocations in the C API. > > If you want to reduce the number of things you have to get your head > around, learn Cython instead of the raw C-API. It's basi

Re: C API and memory allocation

2008-12-17 Thread Floris Bruynooghe
Hello again On Dec 17, 11:06 pm, Floris Bruynooghe wrote: > So I'm assuming PyArg_ParseTuple() > must allocate new memory for the returned string.  However there is > nothing in the API that provides for freeing that allocated memory > again. I've dug a little deeper in

C API and memory allocation

2008-12-17 Thread Floris Bruynooghe
Arg_ParseTuple() must allocate new memory for the returned string. However there is nothing in the API that provides for freeing that allocated memory again. So does this application leak memory then? Or am I misunderstanding something fundamental? Regards Floris -- http://mail.python.org/mailman/listinfo/python-list

Re: C Module question

2008-11-10 Thread Floris Bruynooghe
On Nov 10, 1:18 pm, Floris Bruynooghe <[EMAIL PROTECTED]> wrote: > On Nov 10, 11:11 am, "[EMAIL PROTECTED]" > > <[EMAIL PROTECTED]> wrote: > > 1. How can I pass a file-like object into the C part? The PyArg_* > > functions can convert objects to all sort

Re: C Module question

2008-11-10 Thread Floris Bruynooghe
uot; in PyArg_*), check the type and cast it. Or use "O!" as format string and the typechecking can be done for you, only thing left is casting it. See http://docs.python.org/c-api/arg.html and http://docs.python.org/c-api/file.html for exact details. (2 is answered already...) Regard

Re: Logging thread with Queue and multiple threads to log messages

2008-11-10 Thread Floris Bruynooghe
m will be solved. You might get away with making your threads daemonic, but I can't guarentee you won't run into race conditions in that case. If you want to be really evil you could get into muddling with atexit... Regards Floris -- http://mail.python.org/mailman/listinfo/python-list

Re: Module clarification

2008-07-28 Thread Floris Bruynooghe
  Wow.py > Wow.py is now a module and I can use it in other Python code: > import Wow Indeed, you can now access things defined in Wow as Wow.foo Regards Floris -- http://mail.python.org/mailman/listinfo/python-list

lxml validation and xpath id function

2008-06-30 Thread Floris Bruynooghe
a list that is), but instead I just get an empty list. Is there anything obvious I'm doing wrong? As far as I can see the lxml documentation says this should work. Cheers Floris -- http://mail.python.org/mailman/listinfo/python-list

Context manager for files vs garbage collection

2008-06-16 Thread Floris Bruynooghe
e would be much better, I've got used to just relying on the garbage collector... :-) But what is the use case of a file as a context manager then? Is it only useful if your file object is large and will stay in scope for a long time? Regards Floris -- http://mail.python.org/mailman/listinfo/python-list

Re: Running commands on cisco routers using python

2008-05-20 Thread Floris Bruynooghe
On May 19, 4:18 pm, SPJ <[EMAIL PROTECTED]> wrote: > Is it possible to run specific commands on cisco router using Python? > I have to run command "show access-list" on few hundred cisco routers > and get the dump into a file. Please let me know if it is feasible and > the best way to achieve this.

Re: How to kill Python interpreter from the command line?

2008-05-09 Thread Floris Bruynooghe
On May 9, 11:19 am, [EMAIL PROTECTED] wrote: > Thanks for the replies. > > On May 8, 5:50 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > > > Ctrl+C often works with Python, but as with any language, it's possible > > to write a program which will not respond to it.  You can use Ctrl+\ > > ins

Re: @x.setter property implementation

2008-04-11 Thread Floris Bruynooghe
Oh, that was a good hint! See inline On Apr 11, 12:02 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > On Apr 11, 11:19 am, Floris Bruynooghe <[EMAIL PROTECTED]> > wrote: > [...] > > > > Unfortunatly both this one and the one I posted before work when I try >

Re: @x.setter property implementation

2008-04-11 Thread Floris Bruynooghe
On Apr 11, 10:16 am, Floris Bruynooghe <[EMAIL PROTECTED]> wrote: > On Apr 10, 5:09 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > > > > > On Apr 10, 3:37 pm, Floris Bruynooghe <[EMAIL PROTECTED]> > > wrote: > > > > On Apr 7, 2:19

Re: @x.setter property implementation

2008-04-11 Thread Floris Bruynooghe
On Apr 10, 5:09 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > On Apr 10, 3:37 pm, Floris Bruynooghe <[EMAIL PROTECTED]> > wrote: > > > > > On Apr 7, 2:19 pm, "Andrii V. Mishkovskyi" <[EMAIL PROTECTED]> wrote: > > > > 2008/4/7

Re: @x.setter property implementation

2008-04-10 Thread Floris Bruynooghe
On Apr 7, 2:19 pm, "Andrii V. Mishkovskyi" <[EMAIL PROTECTED]> wrote: > 2008/4/7, Floris Bruynooghe <[EMAIL PROTECTED]>: > > > > > Have been grepping all over the place and failed to find it. I found > > the test module for them, but that doesn'

Re: @x.setter property implementation

2008-04-07 Thread Floris Bruynooghe
On Apr 6, 6:41 pm, "Daniel Fetchinson" <[EMAIL PROTECTED]> wrote: > > I found out about the new methods on properties, .setter() > > and .deleter(), in python 2.6. Obviously that's a very tempting > > syntax and I don't want to wait for 2.6... > > > It would seem this can be implemented entirely i

@x.setter property implementation

2008-04-06 Thread Floris Bruynooghe
efore I go and try to invent this myself does anyone know if there is an "official" implementation of this somewhere that we can steal until we move to 2.6? Cheers Floris -- http://mail.python.org/mailman/listinfo/python-list

Re: Any fancy grep utility replacements out there?

2008-04-04 Thread Floris Bruynooghe
s://svn.enthought.com/svn/sandbox/grin/trunk/ > > > Let me know if you have any requests. > > And don't forget: Colorized output! :) I tried to find something similar a while ago and found ack[1]. I do realise it's written in perl but it does the job nicely. Never needed to search in zipfiles though, just unzipping them in /tmp would always work... I'll check out grin this afternoon! Floris [1] http://petdance.com/ack/ -- http://mail.python.org/mailman/listinfo/python-list

Ignoring windows registry PythonPath subkeys

2008-04-04 Thread Floris Bruynooghe
a problem since we're compiling python anyway, but is that really still the only way? Surely this isn't such an outlandish requirement? Regards Floris [1] http://groups.google.com/group/comp.lang.python/browse_frm/thread/4df87ffb23ac0c78/1b47f905eb3f990a?lnk=gst&q=sys.path+registry#

Re: How to send a var to stdin of an external software

2008-03-14 Thread Floris Bruynooghe
more information / examples about the two solutions > you've proposed (thread or asynchronous I/O) ? The source code of the subprocess module shows how to do it with select IIRC. Look at the implementation of the communicate() method. Regards Floris -- http://mail.python.org/mailman/listinfo/python-list

Re: Altering imported modules

2008-03-04 Thread Floris Bruynooghe
og.doughellmann.com/2008/02/pymotw-pkgutil.html is a fairly detailed look at what pkgutil can do. Regards Floris -- http://mail.python.org/mailman/listinfo/python-list

Re: MSI read support in msilib?

2008-01-17 Thread Floris Bruynooghe
thon? Maybe I should create the diff against the trunk and file a patch report? Regards Floris Index: _msi.c === --- _msi.c (revision 2547) +++ _msi.c (working copy) @@ -339,6 +339,53 @@ } static PyObject* +record_getinte

MSI read support in msilib?

2008-01-16 Thread Floris Bruynooghe
x27;m missing something? Is there an other way to read the data of a record? Regards Floris -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating the windows MSI of python

2007-11-28 Thread Floris Bruynooghe
On Nov 28, 5:26 pm, Christian Heimes <[EMAIL PROTECTED]> wrote: > Floris Bruynooghe wrote: > > It would be great if someone knows how Python builds it's MSI. > > The Tools/ directory contains a script in Tools/msi/msi.py. Martin von > Löwis is using the script to gene

Creating the windows MSI of python

2007-11-28 Thread Floris Bruynooghe
sing something and it will become a maintenance headache on upgrades too. Isn't there some script shipped with python that allows you to build a completely compatible distribution? It would be great if someone knows how Python builds it's MSI. Thanks Floris [1] Ok, not really. What I really w

Re: python in academics?

2007-10-31 Thread Floris Bruynooghe
e) thanks to one lecturer pushing it afaik. Regards Floris -- http://mail.python.org/mailman/listinfo/python-list

Module level descriptors or properties

2007-08-21 Thread Floris Bruynooghe
ome computation later is by using a getter from the start as your public API. This seems ugly to me. Does anyone know of a better way to handle this? Regards Floris -- http://mail.python.org/mailman/listinfo/python-list

Re: win32com

2006-04-07 Thread floris . vannee
get it work you need to remove this code of python line: _reg_desc_ = "Python Test COM Server" I dont know why, but it didn't work with that line, and it did work without the line. Floris -- http://mail.python.org/mailman/listinfo/python-list

win32com

2006-04-07 Thread floris . vannee
VB .NET (if it's possible). Or do I need to use very different python code? (I wasnt sure where to put this, in vb or python section, sorry if its in the wrong section) Thanks in advance, Floris van Nee -- http://mail.python.org/mailman/listinfo/python-list

native hotshot stats module

2005-07-20 Thread Floris Bruynooghe
rings. >From my experience with pystones it is 35% faster in loading the hotshot data then the hotshot.stats.load() method. So there is actually some motivation to use this module. I'm eager to hear your comments. Floris [1] http://c2.com/cgi/wiki?YouArentGonnaNeedIt [2] http://savannah.n

embedding python onto a fox-board

2005-04-23 Thread Floris van Manen
Is there anyone who already ported python onto a acme-systems linux fox-board? http://www.acmesystems.it/ -- http://mail.python.org/mailman/listinfo/python-list