[no subject]

2012-02-28 Thread Brendon Joyce
-- http://mail.python.org/mailman/listinfo/python-list

Python dict as unicode

2010-11-24 Thread Brendon
Hi all, I am trying to convert a dictionary to a unicode string and it fails with an exception. I am awfully surprised but searching the web has not turned up anything useful. I understand why the exception ocurrs, but am not sure why this is the default behaviour of python and if there is anythin

Re: integer >= 1 == True and integer.0 == False is bad, bad, bad!!!

2010-07-11 Thread Brendon Wickham
"i had once considered you one of the foremost intelligent minds within this group. However, after your display within this thread i am beginning to doubt my original beliefs of you." "Oh ... grow a spine already, really. I can't help but thinking of the spineless Robert Ford every time you open y

Re: Few questions on SOAP

2010-02-18 Thread Brendon Wickham
On 19 February 2010 08:07, Mark Lawrence wrote: > Muhammad Alkarouri wrote: >> >> Your question is borderline if not out of topic in this group. I will >> make a few comments though. > > This might be a Python group, but threads often drift way off topic, which > added to the language itself make

Re: Web development with Python 3.1

2009-10-25 Thread Brendon Wickham
> > Anyway, for simple web programming, frameworks are not worth the > hassle. Just use the cgi module. > > I can vouch for what Paul says. I started in Python 3 years ago, and I did so with a web application (still working on it!). I'm using the cgi approach, and it certainly teaches you the conc

Re: What do I do now?

2009-10-12 Thread Brendon Wickham
Speaking of itch, that's exactly the phrase Eric Steven Raymond uses for the same purpose in his famous essay: "Cathedral and the Bazaar" (http://www.catb.org/~esr/writings/cathedral-bazaar/). Someone Something, you should read this essay first, before anything else. Cheers, Brend

Re: IDE for python similar to visual basic

2009-09-11 Thread Brendon Wickham
> > > The interface really should be configurable by the user according to their > needs. The code doesn't need to *know* the position or dimensions of > a widget, or its label or colour or spacing, let alone dictate them. > Perhaps...but the user needs a framework in order to understand the funct

Getting cookie "expires" value

2009-07-22 Thread Brendon Wickham
ot;1234"     cookies['test']['expires'] = 3600     #Save cookie:     print cookies['test']     #Now print HTML:     printHeader()     print "Cookie created." print "" <<<<<<<<<<<<<<<<<<&l

Re: What IDE support python 3.0.1 ?

2009-04-15 Thread Brendon Wickham
> On IDE's, I'm afraid I'm not going to be much help because I don't use > them.  I prefer to use a decent editor (Emacs in my case, others have > their own preferences) and run my scripts from the command line.  That > said, IDLE (which comes packaged with Python) is a perfectly decent > little ID

Re: need to start a new project , can python do all that ?

2009-04-15 Thread Brendon Wickham
ferent. You will most likely need a firm understanding of HL7 v2 and 3, XML, XSL (and probably web services) etc. In terms of cross platform, in the health context it's pointless being anything other than a web application (IMHO). Cheers, Brendon 2009/4/15 Deep_Feelings : > I wan

Re: python for loop

2009-03-31 Thread Brendon Wickham
Since when should a machine (that's what a computer is after all), be forced to contort itself into something that is capable of reflecting the laws of physical matter? Better perhaps to look at it from another angle - it's counter-intuitive to think that the digital should mirror the analogue. Th

Accessing shell output from HTTP

2009-03-30 Thread Brendon Wickham
nt *backupfile* I will get the expected result, but when I'm going through CGI (the script, called from a web browser, is supposed to capture the output into the variable) nothing is being returned by communicate(). Is this possible? Or am I barking up the wrong tree? Cheers, Brendon -- http

Accessing shell output from HTTP

2009-03-29 Thread Brendon Wickham
expected result, but when I'm going through CGI nothing is being returned by communicate(). Is this possible? Or am I barking up the wrong tree? Cheers, Brendon -- http://mail.python.org/mailman/listinfo/python-list

Re: How do i : Python Threads + KeyboardInterrupt exception

2008-06-19 Thread Brendon Costa
> If only the main thread can receive KeyboardInterrupt, is there any > reason why you couldn't move the functionality of the Read thread into > the main thread? It looks like it's not doing any work, just waiting > for the Proc thread to finish. > > You could start the Proc thread, do the current

Re: How do i : Python Threads + KeyboardInterrupt exception

2008-06-19 Thread Brendon Costa
I tested this a bit more. My windows example was incorrect. It should have used CTRL_C_EVENT. But even then, the problem is that the process will also close the console window from which it was called because of the 0. Also this requires that the process actually have a console and is not a GUI app

Re: How do i : Python Threads + KeyboardInterrupt exception

2008-06-18 Thread Brendon Costa
I tested this a bit more. My windows example was incorrect. It should have used CTRL_C_EVENT. But even then, the problem is that the process will also close the console window from which it was called because of the 0. Also this requires that the process actually have a console and is not a GUI app

Re: How do i : Python Threads + KeyboardInterrupt exception

2008-06-18 Thread Brendon Costa
> I don't know the "standard" way, but perhaps you can get some ideas from > this recent > thread:http://groups.google.com/group/comp.lang.python/browse_thread/thread/... > I had a quick read through that thread. I think i will need some more time to think about what they are saying in there thou

How do i : Python Threads + KeyboardInterrupt exception

2008-06-18 Thread Brendon Costa
s to only be recieved by the main thread. Is this ALWAYS the case across all UNIX + windows platforms (not so worried about others)? * Can i somehow get the Proc thread to force the Read thread to generate a KeyboardInterrupt or somehow exit its blocking "for line in fin:" call? Th

Re: Converting _node* to a Code object?

2007-04-01 Thread Brendon Costa
Gabriel Genellina wrote: > En Sun, 01 Apr 2007 01:35:59 -0300, Brendon Costa <[EMAIL PROTECTED]> > escribió: > >> How do i convert a _node* object returned from: >> PyParser_SimpleParseStringFlagsFilename() >> >> into a code obje

Converting _node* to a Code object?

2007-03-31 Thread Brendon Costa
gsFilename() into a code object i can use as a module to import with: PyImport_ExecCodeModule() I cant seem to find any documentation about this. If you are wondering why i want to do this, then you can read on and maybe there is a much better way to achieve what i am after. Thanks, Brendon

PyLint syntax question

2006-11-29 Thread Brendon
at certain files? At the moment I'm trying to get it to avoid the ones that contain 'import wx'. Thanks, Brendon -- http://mail.python.org/mailman/listinfo/python-list

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-28 Thread Brendon Towle
s of the "Why don't destructive sequence operations return the sequence?" thread.) I think I'd probably prefer: def cons(a,b): res = [a] res.extend(b) return res because cons is supposed to leave its second argument untouched. B. -- Brendon Towle, PhD Cog

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-28 Thread Brendon Towle
On 28 Sep 2006, at 8:05 AM, [EMAIL PROTECTED] wrote: > From: Bruno Desthuilliers <[EMAIL PROTECTED]> > Subject: Re: Questions on Using Python to Teach Data Structures and > Algorithms > To: python-list@python.org > > Brendon Towle wrote: >> Some of your Li

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-28 Thread Brendon Towle
return structure[1] should be: return structure[1:] B. -- Brendon Towle, Ph.D. <[EMAIL PROTECTED]> +1-412-362-1530 “Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart

Python API to OS X Address Book?

2006-09-25 Thread Brendon Towle
Essentially, I'm looking for a Python equivalent to the ObjectiveC stuff that can be found at: http://developer.apple.com/documentation/UserExperience/Conceptual/AddressBook/index.html Google got me that far, but was not particularly helpful past that. Anyone have any pointers? B. -- http:

Re: Random Drawing Simulation -- performance issue

2006-09-13 Thread Brendon Towle
vals is a sequence of probabilities that should sum to 1 > (however, the > last element is always assumed to account for the remaining > probability > as long as sum(pvals[:-1]) <= 1). Here, I'm torn. I do want the code to be accessible to non-stats people

Re: Random Drawing Simulation -- performance issue

2006-09-13 Thread Brendon Towle
On 12 Sep 2006, at 6:33 PM, [EMAIL PROTECTED] wrote: > Date: 12 Sep 2006 15:23:51 -0700 > From: "Simon Forman" <[EMAIL PROTECTED]> > Subject: Re: Random Drawing Simulation -- performance issue > > Brendon Towle wrote: >> I need to simulate scenarios like th

Random Drawing Simulation -- performance issue

2006-09-12 Thread Brendon Towle
""" res = [[0, item[1]] for item in population] mapping = [] for i in xrange(len(population)): mapping.extend([i]*population[i][0]) for i in xrange(count): index = random.choice(mapping) res[index][0] += 1 return res

Re: sending emails using python

2006-09-07 Thread Brendon Towle
lib.SMTP(host) if auth: server.login('username', 'password') outMessage = 'From: %s\rTo: %s\rSubject: %s\r%s' % (FROM_HEADER, TO_HEADER, subject, body) server.sendmail(fromAddr, toAddr, outMessage) If this doesn't wo

Re: Consistency in Python

2006-08-25 Thread Brendon Towle
Message: 3 Date: Fri, 25 Aug 2006 15:28:46 +0200 From: "Fredrik Lundh" <[EMAIL PROTECTED]> Subject: Re: Consistency in Python Brendon Towle wrote: So, my question is: Someone obviously thought that it was wise and proper to require the longer versions that I write above. Why? a

Re: Consistency in Python

2006-08-25 Thread Brendon Towle
 lst.append(INVARIANT)    lst.sort()    return lst[:n]So, my question is: Someone obviously thought that it was wise and proper to require the longer versions that I write above. Why?B. -- Brendon Towle, PhDCognitive Scientist+1-412-690-2442x127Carnegie Learning, Inc.The Cognitive Tutor Company

Re: List Splitting

2006-08-21 Thread Brendon Towle
...        temp.append(t[3*y+x])...    outlist.append(temp)>>>outlist[['a', 'n', 't'], ['b', 'a', 't'], ['c', 'a', 't']] -- Brendon Towle, PhDCognitive Scientist+1-412-690-2442x127Carnegie Learning, Inc.The Cognitive Tutor Company ®Helping over 375,000 students in 1000 school districts succeed in math. -- http://mail.python.org/mailman/listinfo/python-list

Re: Eval (was Re: Question about the use of python as a scripting language)

2006-08-10 Thread Brendon Towle
On 10 Aug 2006, at 10:46 AM, [EMAIL PROTECTED] wrote:    Brendon> A shortcut occurs to me; maybe someone can tell me what's wrong    Brendon> with my reasoning here. It seems that any string that is unsafe    Brendon> to pass to eval() must involve a function call, and thus m

Re: Eval (was Re: Question about the use of python as a scripting language)

2006-08-10 Thread Brendon Towle
Oops -- I missed the subject line on my last post.On 10 Aug 2006, at 9:41 AM, [EMAIL PROTECTED] wrote:    Brendon> Seems that parsing negative numbers is outside of the scope of    Brendon> this routine. Here's the source (which is Frederik's source    Brendon> with one minor

Re: Python-list Digest, Vol 35, Issue 160

2006-08-10 Thread Brendon Towle
Date: Thu, 10 Aug 2006 08:51:12 -0400From: Brendon Towle <[EMAIL PROTECTED]>Subject: Re: Eval (was Re: Question about using python as a scripting language) Date: 9 Aug 2006 14:12:01 -0700From: "Simon Forman" <[EMAIL PROTECTED]>Subject: Re: Eval (was Re: Question about using

Re: Eval (was Re: Question about using python as a scripting language)

2006-08-10 Thread Brendon Towle
posted a great piece of code to parse a subset of pythonsafely:http://groups.google.ca/group/comp.lang.python/browse_frm/thread/8e427c5e6da35c/a34397ba74892b4eThis, as it turns out, was the most helpful pointer of them all -- thanks!B. -- Brendon Towle, PhDCognitive Scientist+1-412-690-2442x127Carn

Re: Eval (was Re: Question about using python as a scripting language)

2006-08-09 Thread Brendon Towle
On 9 Aug 2006, at 12:03 PM, [EMAIL PROTECTED] wrote:    Brendon> I could do that, or I could do something like the re.* trick    Brendon> mentioned by another poster. But, doesn't it offend anyone else    Brendon> that the only clean way to access functionality that's already   

Re: Eval (was Re: Question about using python as a scripting language)

2006-08-09 Thread Brendon Towle
ke the re.* trick mentioned by another poster. But, doesn't it offend anyone else that the only clean way to access functionality that's already in Python is to write long complicated Python code? Python already knows how to extract a list object from a string; why should I have to rewr

Eval (was Re: Question about using python as a scripting language)

2006-08-09 Thread Brendon Towle
this is from memory, and the code actually works.)My question is: what's the safe way to do this?B. -- Brendon Towle, PhDCognitive Scientist+1-412-690-2442x127Carnegie Learning, Inc.The Cognitive Tutor Company ®Helping over 375,000 students in 1000 school districts succeed in math. -- http://mail.python.org/mailman/listinfo/python-list