seeking deeper (language theory) reason behind Python design choice

2018-05-07 Thread all-lists
Hi, I was wondering (and have asked on StackOverflow [1] in a more elaborate way) whether there is a deeper reason to not allow assignments in lambda expressions. I'm not criticising, I'm asking in order to know ;-) The surface-reason is the distinction between assignments and statements, but wh

Re: HTML templating tools

2016-10-21 Thread lists
+1 for Jinja2. I love that shit On 2016-10-20 23:16, Adrian Petrescu wrote: On Thu, 20 Oct 2016 11:34:36 +0200, Tony van der Hoff wrote: Can anyone recommend a suitable replacement (preferably compatible with htmltmpl)? I don't think anything is going to be compatible with htmltmpl, but Jin

Re: numpy problem

2016-05-23 Thread lists
> > On 23 mei 2016, at 14:19, Peter Otten <__pete...@web.de> wrote: > > li...@onemanifest.net wrote: > >> I've got a 2D array with values: >> >> values = np.array( >> [[ 20, 38, 4, 45, 65], >> [ 81, 44, 38, 57, 92], >> [ 92, 41, 16, 77, 44], >> [ 53, 62, 9, 75, 12], >> [ 58, 2, 60, 100,

numpy problem

2016-05-23 Thread lists
Hi, I've got a nympy problem I can't get my head around. (numpy is new to me). I've got a 2D array with values: values = np.array( [[ 20, 38, 4, 45, 65], [ 81, 44, 38, 57, 92], [ 92, 41, 16, 77, 44], [ 53, 62, 9, 75, 12], [ 58, 2, 60, 100, 29], [ 63, 15, 48, 43, 71], [ 80, 97, 87,

Detecting an active exception

2007-06-01 Thread NeBlackCat (lists)
Hello everybody - my first post! And it may be the most monumentally stupid question ever asked, but I just can't see an answer after several hours experimenting, searching and reading. It's simply this - how can a function determine whether or not it's being called in handling of an exception

About getattr()

2007-02-11 Thread Jm lists
Hello, Since I can write the statement like: >>> print os.path.isdir.__doc__ Test whether a path is a directory Why do I still need the getattr() func as below? >>> print getattr(os.path,"isdir").__doc__ Test whether a path is a directory Thanks! -- http://mail.python.org/mailman/listinfo/pyt

Re: Does eval has the same features as Perl's?

2007-01-20 Thread Jm lists
Thank you.I'm just learning Python and want to make something clear to me.:) 2007/1/20, Steven D'Aprano <[EMAIL PROTECTED]>: > On Sat, 20 Jan 2007 17:30:24 +0800, Jm lists wrote: > > > Hello members, > > > > I want to know does the "eval" in pyt

Does eval has the same features as Perl's?

2007-01-20 Thread Jm lists
Hello members, I want to know does the "eval" in python have the same features as in Perl (capture errors)? For example,in perl I can wrote: $re = eval { 1 / 0 }; Though 1/0 is a fatal error but since it's in "eval" block so the perl interpreter doesn't get exit. Thanks again. -- http://mail.

Re: **argv can't work

2007-01-19 Thread Jm lists
Thanks for all the kind helps! 2007/1/20, Parthan SR <[EMAIL PROTECTED]>: > > > On 1/20/07, Jm lists <[EMAIL PROTECTED]> wrote: > > hello members, > > > > See my script piece below: > > > > def testB(shift,**argv): > > print "first

**argv can't work

2007-01-19 Thread Jm lists
hello members, See my script piece below: def testB(shift,**argv): print "first argument is %s" %shift print "all other arguments are:",argv testB('mails','Jen','[EMAIL PROTECTED]','Joe','[EMAIL PROTECTED]') It can't work at all.please help tell me the reasons.thanks. -- http://mail.py

Re: Why this script can work?

2007-01-19 Thread Jm lists
-e line 1, near "}else" Execution of -e aborted due to compilation errors. 2007/1/19, Diez B. Roggisch <[EMAIL PROTECTED]>: > Jm lists wrote: > > > Please help with this script: > > > > class ShortInputException(Exception): > >

Why this script can work?

2007-01-18 Thread Jm lists
Please help with this script: class ShortInputException(Exception): '''A user-defined exception class.''' def __init__(self,length,atleast): Exception.__init__(self) self.length=length self.atleast=atleast try: s=raw_input('E

Re: mean ans std dev of an array?

2006-10-23 Thread Éric Daigneault lists
Simplest I see is to do it manually. If your array data is numeric compatible mean = sum(a)/len(a) as for the standard Deviation it depends on the nature of your data... check out http://en.wikipedia.org/wiki/Standard_deviation for info on that... but in all a for loop with a few calculati

python class instantiation

2006-10-23 Thread Éric Daigneault lists
Got a question for you all... I noticed a behaviour in python class creation that is strange, to say the least. When creating a class with data members but no __init__ method. Python deals differently with data members that are muatable and immutables. Ex: class A(object): stringData = "W

SOAP/WSDL Introspection

2006-08-01 Thread Ben Edwards (lists)
I have the below code to get info about SOAP services at a wsdl url. It gets the in parameters OK but does not seem to get out/return parameters. Any idea why? Ben from SOAPpy import WSDL import sys wsdlfile = "http://www.xmethods.net/sd/2001/TemperatureService.wsdl"; server = WSDL.Proxy(wsdl

Another problem with 'Dive Into Python'

2006-07-31 Thread Ben Edwards (lists)
Am going through Chapter 9 - HTTP Web Services in dive into Python. It uses the following: data = urllib.urlopen('http://diveintomark.org/xml/atom.xml').read() The page no longer exists, can anyone recommend an alternative page to use? Ben -- http://mail.python.org/mailman/listinfo/python-l

Unicode question

2006-07-28 Thread Ben Edwards (lists)
I am using python 2.4 on Ubuntu dapper, I am working through Dive into Python. There are a couple of inconsictencies. Firstly sys.setdefaultencoding('iso−8859−1') does not work, I have to do sys.setdefaultencoding = 'iso−8859−1' secondly the following does not give a 'UnicodeError: ASCII encodin

Possible error in 'dive into Python' book, help!

2006-07-28 Thread Ben Edwards (lists)
I have been going through Dive into Python which up to now has been excellent. I am now working through Chapter 9, XML Processing. I am 9 pages in (p182) in the 'Parsing XML section. The following code is supposed to return the whole XML document (I have put ti at the end of this email): from x

Re: Exercises for dive into python

2006-07-25 Thread Ben Edwards (lists)
On Mon, 2006-07-24 at 23:16 +0200, Tal Einat wrote: > > snip... > > > > > > I recently gave a Python crash-course in my company, and ran > into the same > > problem. There are many good Python tutorials, manuals, > references etc., most >

Re: Exercises for dive into python

2006-07-24 Thread Ben Edwards (lists)
On Mon, 2006-07-24 at 16:39 +, Tal Einat wrote: > Ben Edwards (lists videonetwork.org> writes: > > > > > Have been working through Dive Into Python which is excellent. My only > > problem is that there are not exercises. I find exercises are a great > >

Exercises for dive into python

2006-07-24 Thread Ben Edwards (lists)
Have been working through Dive Into Python which is excellent. My only problem is that there are not exercises. I find exercises are a great way of helping stuff sink in and verifying my learning. Has anyone done such a thing? Ben -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing my own typing monitor program for RSI sufferers...

2006-02-20 Thread Sam&#x27;s Lists
Skip... So, so close  The problem with this implementation is that it doesn't monitor usb keyboards under linux at all as far as I can tellsince no keyboard entry will show up in /proc/interrupts with a usb keyboard.  I absolutely need the keyboard monitoring as well. Otherwise, your proj

MySQL posting confirmation for python-list@python.org

2005-07-04 Thread MySQL Lists Automoderator
This is an automatic reply to an email you sent to a MySQL mailing address protected by our 'self-moderation' system. To reduce the amount of spam received at these addresses, we require you to confirm that you're a real person before your email will be allowed through. Unfortunately, we got a bou