Re: Python program termination and exception catching

2011-04-10 Thread Jason Swails
On Sun, Apr 10, 2011 at 4:49 PM, Jerry Hill wrote: > On Sun, Apr 10, 2011 at 3:25 PM, Jason Swails > wrote: > > > > Hello everyone, > > > > This may sound like a bit of a strange desire, but I want to change the > way in which a python program quits if an exception is not caught. The > program

Have a nice day.

2011-04-10 Thread Ashraf Ali
Sale Sale Sale. Just visit the following link to buy computer accessories. You can buy computer accessories on reasonable prices. just visit http://www.onlineshoppingpk.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Free software versus software idea patents

2011-04-10 Thread Westley Martínez
On Mon, 2011-04-11 at 10:18 +1000, Chris Angelico wrote: > On Mon, Apr 11, 2011 at 10:04 AM, harrismh777 wrote: > >Not so fast there, Steve. If they [Microsoft] are paying anything > > (unsubstantiated, unknowable) to Python, Apache, or (Linux, whatever you > > mean by that term...) there are

Re: [OT] Free software versus software idea patents

2011-04-10 Thread harrismh777
Chris Angelico wrote: > All software can be expressed as lambda calculus. The point being, all > software is mathematics... With enough software, you can simulate anything. That means that the entire universe can be expressed as lambda calculus. Does that mean that nothing can ever be pa

Re: Creating unit tests on the fly

2011-04-10 Thread Roy Smith
In article , Raymond Hettinger wrote: > I think you're going to need a queue of tests, with your own test > runner consuming the queue, and your on-the-fly test creator running > as a producer thread. > > Writing your own test runner isn't difficult. 1) wait on the queue > for a new test case

Re: [OT] Free software versus software idea patents

2011-04-10 Thread harrismh777
Chris Angelico wrote: Not so fast there, Steve. If they [Microsoft] are paying anything > (unsubstantiated, unknowable) to Python, Apache, or (Linux, whatever you > mean by that term...) there are only two motives: http://www.python.org/psf/ - Microsoft is listed. http://www.apache.o

Re: [OT] Free software versus software idea patents

2011-04-10 Thread Chris Angelico
On Mon, Apr 11, 2011 at 10:04 AM, harrismh777 wrote: >    Not so fast there, Steve. If they [Microsoft] are paying anything > (unsubstantiated, unknowable) to Python, Apache, or (Linux, whatever you > mean by that term...) there are only two motives: http://www.python.org/psf/ - Microsoft is list

Re: [OT] Free software versus software idea patents

2011-04-10 Thread harrismh777
Steven D'Aprano wrote: > What do you mean 'just like"?They are nothing alike. All three of Python, Apache and Linux have accepted donations from Microsoft. Microsoft is a corporate sponsor of the PSF. Microsoft is not in the business of donating money and time to competitors out of the

Re: Argument of the bool function

2011-04-10 Thread Ben Finney
Mel writes: > Python is a pragmatic language, so all the rules come pre-broken. +1 QOTW -- \ “Science shows that belief in God is not only obsolete. It is | `\also incoherent.” —Victor J. Stenger, 2001 | _o__)

Re: Python program termination and exception catching

2011-04-10 Thread Jerry Hill
On Sun, Apr 10, 2011 at 3:25 PM, Jason Swails wrote: > > Hello everyone, > > This may sound like a bit of a strange desire, but I want to change the way > in which a python program quits if an exception is not caught.  The program > has many different classes of exceptions (for clarity purposes)

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-10 Thread sturlamolden
On 8 apr, 03:10, sturlamolden wrote: > That was easy, 64-bit support for Windows is done :-) > > Now I'll just have to fix the Linux code, and figure out what to do > with os._exit preventing clean-up on exit... :-( Now it feel dumb, it's not worse than monkey patching os._exit, which I should h

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-10 Thread sturlamolden
On 10 apr, 18:27, John Nagle wrote: >     Unless you have a performance problem, don't bother with shared > memory. > >     If you have a performance problem, Python is probably the wrong > tool for the job anyway. Then why does Python have a multiprocessing module? In my opinion, if Python has

Re: Python program termination and exception catching

2011-04-10 Thread Benjamin Kaplan
On Sun, Apr 10, 2011 at 4:05 PM, Jason Swails wrote: > > > On Sun, Apr 10, 2011 at 12:34 PM, Laszlo Nagy wrote: >> >> 2011.04.10. 21:25 keltezéssel, Jason Swails írta: >> >> Hello everyone, >> >> This may sound like a bit of a strange desire, but I want to change the >> way in which a python prog

Re: Python program termination and exception catching

2011-04-10 Thread Jason Swails
On Sun, Apr 10, 2011 at 12:34 PM, Laszlo Nagy wrote: > 2011.04.10. 21:25 keltezéssel, Jason Swails írta: > > Hello everyone, > > This may sound like a bit of a strange desire, but I want to change the > way in which a python program quits if an exception is not caught. The > program has many di

Re: Python program termination and exception catching

2011-04-10 Thread Laszlo Nagy
2011.04.10. 21:25 keltezéssel, Jason Swails írta: Hello everyone, This may sound like a bit of a strange desire, but I want to change the way in which a python program quits if an exception is not caught. The program has many different classes of exceptions (for clarity purposes), and they'r

Python program termination and exception catching

2011-04-10 Thread Jason Swails
Hello everyone, This may sound like a bit of a strange desire, but I want to change the way in which a python program quits if an exception is not caught. The program has many different classes of exceptions (for clarity purposes), and they're raised whenever something goes wrong. Most I want to

Re: Retrieving Python Keywords

2011-04-10 Thread Terry Reedy
On 4/10/2011 5:12 AM, candide wrote: Le 10/04/2011 04:01, Terry Reedy a écrit : Yes. (Look in the manuals, I did : my main reference book is the Martelli's /Python in a Nutshell/ You should only use that as a supplement. and the index doesn't refer to the keyword import and now you kno

Re: Argument of the bool function

2011-04-10 Thread Colin J. Williams
On 10-Apr-11 12:21 PM, Mel wrote: Chris Angelico wrote: Who would use keyword arguments with a function that takes only one arg anyway? It's hard to imagine. Maybe somebody trying to generalize function calls (trying to interpret some other language using a python program?) # e.g. input win

Re: OOP only in modules

2011-04-10 Thread Andrea Crotti
newpyth writes: [...] > My main goal is to arrange OO in a paradigmatic manner in order to > apply to it the > procedural scheme. especially to the caller or called modules. > Bye. I have some troubles understanding what you mean. Can you write an example of code that it's for you annoying and

Re: Encoding problem when launching Python27 via DOS

2011-04-10 Thread MRAB
On 10/04/2011 13:22, Jean-Pierre M wrote: > I created a simple program which writes in a unicode files some french text with accents! [snip] This line: l.p("premier message de Log à accents") passes a bytestring to the method, and inside the method, this line: unicode_str=u'%s : %s \n

Re: [OT] Free software versus software idea patents

2011-04-10 Thread Westley Martínez
On Sat, 2011-04-09 at 23:55 +, Steven D'Aprano wrote: > On Fri, 08 Apr 2011 01:37:45 -0500, harrismh777 wrote: > > > Steven D'Aprano wrote: > >>> The reason Mono gets hit (from others besides me) is that they are in > >>> > partnership and collaboration with Microsoft, consciously and > >>>

Re: OOP only in modules

2011-04-10 Thread newpyth
Hi all, I must thank before Andrea Crotti and Steven D'Aprano, which kindly replayed to my post... they deserve an answer. To Andrea Crotti's "OOP makes life easier also to the user"... that is NOT my experience... I'm not pretending that everyone else thinks like me (also if many people do... load

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-10 Thread John Nagle
On 4/10/2011 9:11 AM, Miki Tebeka wrote: Now, I don't know that I actually HAVE to pass my neural network and input data as copies -- they're both READ-ONLY objects for the duration of an evaluate function (which can go on for quite a while). One option in that case is to use "fork" (if you're o

Re: Argument of the bool function

2011-04-10 Thread Mel
Chris Angelico wrote: > Who would use keyword arguments with a function that takes only one arg > anyway? It's hard to imagine. Maybe somebody trying to generalize function calls (trying to interpret some other language using a python program?) # e.g. input winds up having the effect of .. fun

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-10 Thread Miki Tebeka
> Now, I don't know that I actually HAVE to pass my neural network and > input data as copies -- they're both READ-ONLY objects for the > duration of an evaluate function (which can go on for quite a while). One option in that case is to use "fork" (if you're on a *nix machine). See http://pythonwi

ANN: A new version (0.2.7) of the Python module which wraps GnuPG has been released.

2011-04-10 Thread Vinay Sajip
A new version of the Python module which wraps GnuPG has been released. What Changed? = This is a minor enhancement and bug-fix release. See the project website ( http://code.google.com/p/python-gnupg/ ) for more information. Summary: Better support for status messages from GnuPG. The

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-10 Thread sturlamolden
On 9 apr, 22:18, John Ladasky wrote: > So, there are limited advantages to trying to parallelize the > evaluation of ONE cascade network's weights against ONE input vector. > However, evaluating several copies of one cascade network's output, > against several different test inputs simultaneously

Re: How to program in Python to run system commands in 1000s of servers

2011-04-10 Thread Chris Angelico
On Mon, Apr 11, 2011 at 12:22 AM, Babu wrote: > Are there any more different approaches?  I suppose if we take the > daemon approach then we can make it as a webservice as well? Yes, your daemon could function via HTTP. But if you go that route, you would need some way to collect all the differen

Re: How to program in Python to run system commands in 1000s of servers

2011-04-10 Thread Babu
On Apr 8, 5:40 am, Thomas Rachel wrote: > Am 07.04.2011 21:14, schrieb Anssi Saari: > > > Chris Angelico  writes: > > >> Depending on what exactly is needed, it might be easier to run a > >> separate daemon on the computers, one whose sole purpose is to do the > >> task / get the statistics needed

Re: OOP only in modules

2011-04-10 Thread Steven D'Aprano
On Sun, 10 Apr 2011 03:35:48 -0700, newpyth wrote: > Hi all, > from the subject of my post, you can see I do not like very much OOP... > and I am not the only one... Knowing that python is intrinsecally OO, I > propose to move all OOP stuff (classes, instances and so on) to modules. Python is bas

Re: design question

2011-04-10 Thread Andrea Crotti
Andrea Crotti writes: [...] I left the Timeline as before, but tried to rewrite some more classes. This is the abstract class for a metric, and below another class for the metric which involve only counting things. In the end an example on how to use this. I need to see synthetic values during

Re: Argument of the bool function

2011-04-10 Thread Chris Angelico
On Sun, Apr 10, 2011 at 10:54 PM, candide wrote: > Anyway, passing x as a keyword argument to the bool function appears to be > very rare : i did a regexp search for about 3 source-code Python files > (among them official Python source-code, Django, Sphinx, Eric source-code > and many more sou

Re: Argument of the bool function

2011-04-10 Thread candide
Le 08/04/2011 18:41, Benjamin Kaplan a écrit : bool(x=5) is just passing the value 5 as the argument "x" to the function. Anyway, passing x as a keyword argument to the bool function appears to be very rare : i did a regexp search for about 3 source-code Python files (among them offici

Encoding problem when launching Python27 via DOS

2011-04-10 Thread Jean-Pierre M
I created a simple program which writes in a unicode files some french text with accents! *# -*- coding: cp1252 -*-* *#!/usr/bin/python* *'''* *Created on 27 déc. 2010* * * *@author: jpmena* *'''* *from datetime import datetime* *import locale* *import codecs* *import os,sys* * * *class Log(object)

Re: DOCTYPE + SAX

2011-04-10 Thread jdownie
What you suggested solved my problem, but unfortunately it did reveal that the HTML that I was parsing was not compliant with the DTD that it should have been. There were a lot of missing end tags. In light of this frustrating problem i've gone back to the source docbook code. There are many is

Timebased Function Scheduler with Pause and UnPause functionality

2011-04-10 Thread Narendra Sisodiya
I wrote some dirty script for Function Scheduling and pausing them ! May some look and point mistakes, I am totally new to python ! https://gist.github.com/911942 -- ┌─┐ │    Narendra Sisodiya │    http://narendrasisodiya.com └─┘ -- http://mail.py

Re: OOP only in modules

2011-04-10 Thread Andrea Crotti
newpyth writes: > Hi all, > from the subject of my post, you can see I do not > like very much OOP... and I am not the only one... > Knowing that python is intrinsecally OO, I propose > to move all OOP stuff (classes, instances and so on) > to modules. > In this way the OOP fan can keep on using

design question

2011-04-10 Thread Andrea Crotti
I've been wondering for weeks now how to do but I still didn't get a satisfying answer, so I hope someone can give a hint... I have some logs which I extract from simulation results. These logs are in the form timestamp, nodeid, eventname, event_argument and now I have to analyze the data. I don

OOP only in modules

2011-04-10 Thread newpyth
Hi all, from the subject of my post, you can see I do not like very much OOP... and I am not the only one... Knowing that python is intrinsecally OO, I propose to move all OOP stuff (classes, instances and so on) to modules. In this way the OOP fan can keep on using it, but in a module recalled by

Re: Retrieving Python Keywords

2011-04-10 Thread candide
Le 10/04/2011 04:01, Terry Reedy a écrit : Yes. (Look in the manuals, I did : my main reference book is the Martelli's /Python in a Nutshell/ and the index doesn't refer to the keyword import or try the obvious imports ;-) The only obvious I saw was sys module. -- http://mail.python

Re: Retrieving Python Keywords

2011-04-10 Thread candide
Le 10/04/2011 04:09, John Connor a écrit : Actually this is all it takes: import keywords print keywords.kwlist >>> import keywords Traceback (most recent call last): File "", line 1, in ImportError: No module named keywords >>> so I considered first it was a joke ! ;) In fact the import