Re: [Info] PEP 308 accepted - new conditional expressions

2005-10-07 Thread Simon Brunning
On 07/10/05, Eric Nieuwland <[EMAIL PROTECTED]> wrote: > Ever cared to check what committees can do to a language ;-) +1 QOTW. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: how to(can we ?) pass argument to .py script ?

2005-10-11 Thread Simon Brunning
st.py -t > > and then, i may get "-t" within test.py for later use. > > i have no ideas how to do and i'm really stuck, can anyone help ? Short answer: import sys print sys.argv You might also want to take to butchers at the optparse module. -- Cheers, Simon B, [EMAIL

Re: slots? SLOTS?

2005-10-12 Thread Simon Brunning
On 12/10/05, tin gherdanarra <[EMAIL PROTECTED]> wrote: > what is a "slot" in python? <http://www.python.org/doc/current/ref/slots.html> -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: subtle side effect of generator/generator expression

2005-10-16 Thread Simon Percivall
If you find that you want to iterate over an iterable multiple times, have a look at the solution that the tee() function in the itertools module provides (http://docs.python.org/lib/itertools-functions.html). (Have a look at the rest of the itertools module as well, for that matter.) -- http://m

Re: Yes, this is a python question, and a serious one at that (moving to Win XP)

2005-10-19 Thread Simon Brunning
Besides, it is possible to prefer Windows. Odd, but possible. Having moved from Windows to Mac recently myself, I know *I* won't be switching back, but reasonable men can differ. -- Though-clearly-not-differ-with-me-ly y'rs, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python variables are bound to types when used?

2005-10-19 Thread Simon Brunning
ing? > > and what if I never used it in the definition body? Now you've lost me. Probably my problem - serves me right for posting from the pub. > Elucidate please. I'll allow a true Python Zen master to do that - <http://effbot.org/zone/python-objects.htm>. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing a dll from Python

2005-10-21 Thread Simon Brunning
On 21/10/05, Grant Edwards <[EMAIL PROTECTED]> wrote: > Sorry, I've no clue about anything VB-related unless it's > Victoria Bitter. +1 QOTW. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple server/client application

2005-10-24 Thread Simon Percivall
You're calling the grid() method on the Entry object you're instanciating. Are you sure that the grid() method returns the Entry object so that you're actually binding it to self.myAddress? -- http://mail.python.org/mailman/listinfo/python-list

how to use new AST goodies

2005-10-24 Thread Simon Burton
ST objects ? thanks, Simon. -- http://mail.python.org/mailman/listinfo/python-list

Re: namespace dictionaries ok?

2005-10-24 Thread Simon Burton
;, size='large', shape='ball') ) This is looking like foo should be a method of Context now, but in my situation foo is already a method of another class. Simon. -- http://mail.python.org/mailman/listinfo/python-list

Re: namespace dictionaries ok?

2005-10-25 Thread Simon Burton
stores state/context information about the current traversal. Simon. -- http://mail.python.org/mailman/listinfo/python-list

Re: syntax question - if 1:print 'a';else:print 'b'

2005-10-27 Thread Simon Brunning
On 27/10/05, Gregory Piñero <[EMAIL PROTECTED]> wrote: > So much for writing my whole program on one line :-( http://www.unixuser.org/~euske/pyone/ But you didn't hear it from me, OK? ;-) -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://m

Re: Python and DevTrack?

2005-11-02 Thread Simon Brunning
love to get access > to DevTrack in the same way, but it's looking like it's off limits, UI > only. Does anyone have any experience with this? Much appreciated. I > have searched the posts, came up with nothing. For driving Windows GUIs, check out WATSUP. But be warned, it

Re: Python's website does a great disservice to the language

2005-11-02 Thread Simon Brunning
On 02/11/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > a version of Paint that works on a Mac, an obstreperous mentality, > and a sense of humour. what else do you need? Biscuits. You need biscuits. Treating-this-thread-as-seriously-as-it-deserves-ly y'rs, Simon B. -- http:

Re: Pythonwin - Word automation - Removing watermark not working

2005-11-05 Thread Simon Brunning
On 04/11/05, Gregory Piñero <[EMAIL PROTECTED]> wrote: > Is there a different group/mailing list I should try? Does anyone know if > there is a pythonwin group/list for example? There is: <http://mail.python.org/mailman/listinfo/python-win32>. -- Cheers, Simon B, [EMAI

Re: Addressing the last element of a list

2005-11-08 Thread Simon Brunning
ct on other references to the original object. Reset your brain - <http://effbot.org/zone/python-objects.htm>. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: what the %?....

2005-11-08 Thread Simon Brunning
ee <http://docs.python.org/ref/binary.html> and <http://en.wikipedia.org/wiki/Modular_arithmetic>. Over strings, '%' performs string formatting. See <http://docs.python.org/lib/typesseq-strings.html>. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simo

Re: Pywin32: How to import data into Excel?

2005-11-08 Thread Simon Brunning
-as-workbook and any formatting you need afterwards. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: any python module to calculate sin, cos, arctan?

2005-11-08 Thread Simon Brunning
On 08/11/05, Shi Mu <[EMAIL PROTECTED]> wrote: > any python module to calculate sin, cos, arctan? <http://docs.python.org/lib/module-math.html> I seem to be posting loads of links to the docs today... -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon

Re: Sorting Documentation

2005-11-08 Thread Simon Brunning
p://docs.python.org/lib/built-in-funcs.html#l2h-66>. (All found from here, BTW - <http://docs.python.org/lib/genindex.html>.) -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Sorting Documentation

2005-11-08 Thread Simon Brunning
On 8 Nov 2005 02:32:44 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > For example, where can I find the official documentation on the > list.sort() method? <http://docs.python.org/lib/typesseq-mutable.html> -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonl

Re: output question 1

2005-11-10 Thread Simon Brunning
d by default, and you are printing that. > i=i+1 One simple fix - change the summary method to returnt the values rather than print them - replace 'print' with 'return' in that method. Another would be not to print the returned values - remove 'print' from your w

Re: Is there a built-in method for transforming (1, None, "Hello!") to 1, None, "Hello!"?

2005-11-11 Thread Simon Brunning
27;) >>> 1,None,"Hello!" (1, None, 'Hello!') They are both tuples contining identicle elements. What is it that you want to do? -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Countdown

2005-11-11 Thread Simon Brunning
uns to 214 and stops. Why is > this program only counting to 986Anybody have an answer?? > I am using Python 2.4.2 Look at this: import sys sys.getrecursionlimit() It's set to 1000 by default. (Are you using IDLE or something? That would explain where your other 14 levels of s

Re: Python Countdown

2005-11-11 Thread Simon Brunning
t it in site.py, I suppose, but in general, I prefer iteration over recursion in Python. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: string help

2005-11-15 Thread Simon Brunning
ave some > suggestions for this??... It's not because "O and Q are present in the entire string" - it's because your expression prefixes == "O" or "Q" evaluates as (prefixes == "O") or ("Q") Since a string containing a value always evaluates as true, your expression was always true, too. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python worth it??

2005-11-15 Thread Simon Brunning
ni-project of your own, don't be afraid to dive off and give it a go. Try to solve you own problems for a while, 'cos that's a valuable skill, but don't get to the point of frustration. Ask for help here or on the tutor mailing list[1]. And have fun. [1] http://mail.python.org/mai

Re: how to think like a computer scientist

2005-11-15 Thread Simon Brunning
s. That's what the list and (especially) the tutor list are for. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: compare list

2005-11-15 Thread Simon Brunning
ced as a built-in at Python 2.4. If you have 2.3, there's an analogous module. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: compare list

2005-11-15 Thread Simon Brunning
set' is not defined I said analogous, not identical. try (untested): from sets import Set as set -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: compare list

2005-11-15 Thread Simon Brunning
; File "C:\temp\try.py", line 8, in ? > from sets import Set as set > ImportError: cannot import name Set > >>> Works for me. You don't have a sets module of your own, do you? Try this, and report back what you see: import sets print sets

Re: compare list

2005-11-15 Thread Simon Brunning
t; lisB=[9,5,0,2] > lisC=[9,5,0,1] > def two(sequence1, sequence2): >set1, set2 = set(sequence1), set(sequence2) >return len(set1.intersection(set2)) == 2 > print two(lisA,lisB) > False(should be true!) It looks to me like A and B have three members in common - 2, 5 an

Re: Can anyone tell me if pygame and Tkinter can work together?

2005-11-16 Thread Simon Brunning
On 16/11/05, Nathan Pinno <[EMAIL PROTECTED]> wrote: > It worked, but unfornately I can't use this line as it brings up errors: > > from Tkinter (or pygame) import * > > Anyway around this little bug? What's the error? -- Cheers, Simon B, [EMAIL PROTECTED], http

Re: Adding through recursion

2005-11-18 Thread Simon Brunning
looking for from within your function, then print the return value from that function, which, as I've explained, will be None. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding through recursion

2005-11-18 Thread Simon Brunning
tatement ? There is no return statement in your else block. That's where the Nones are coming from. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: the PHP ternary operator equivalent on Python

2005-11-18 Thread Simon Brunning
On 18 Nov 2005 10:53:04 -0800, Daniel Crespo <[EMAIL PROTECTED]> wrote: > I would like to know how can I do the PHP ternary operator/statement > (... ? ... : ...) in Python... Wait for Python 2.5 - <http://www.python.org/peps/pep-0308.html>. -- Cheers, Simon B, [EMAI

Re: Controlling windows gui applications from python

2005-11-18 Thread Simon Brunning
a way to do these things from within Python? <http://www.tizmoi.net/watsup/intro.html> -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python weak on the web side?

2005-11-20 Thread Simon Brunning
bogears, which is based on CherryPy: http://www.turbogears.org/ See also Django for CMS type sites. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

linking one extension module to another (Mac OSX)

2005-11-21 Thread Simon Burton
get neither of them work on OSX (let alone windows). Simon. -- http://mail.python.org/mailman/listinfo/python-list

Re: Controlling windows gui applications from python

2005-11-22 Thread Simon Brunning
's already there. > trying out the examples, here are some problems I am running into: (snip) I'm afraid I can't really help you here. I'm a Mac user these days! You might have some luck with the WATSUP user mailing list - <https://lists.sourceforge.net/lists/listinfo/w

Re: user-defined operators: a very modest proposal

2005-11-23 Thread Simon Brunning
On 23/11/05, Joseph Garvin <[EMAIL PROTECTED]> wrote: > What do you mean by unicode operators? Link? http://fishbowl.pastiche.org/2003/03/19/jsr666_extended_operator_set -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman

Re: Converting a flat list to a list of tuples

2005-11-23 Thread Simon Brunning
On 22/11/05, Bengt Richter <[EMAIL PROTECTED]> wrote: > That would be a counter-intuitive thing to do. Most things go left->right > in order as the default assumption. +1 -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/m

Re: SelfExtract with zipfile

2005-11-23 Thread Simon Brunning
On 23/11/05, Catalin Lungu <[EMAIL PROTECTED]> wrote: > Hi, > I need to compress files in self-extract archive. I use the zipfile module. > Is there an option or parameter to do that? No, AFAIK. If you have a command line tool, perhaps you could try driving that. -- Cheers,

Re: user-defined operators: a very modest proposal

2005-11-23 Thread Simon Brunning
On 23/11/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > see also: > > http://www.brunningonline.net/simon/blog/archives/000666.html > http://www.python.org/peps/pep-0666.html PEP 666 should have been left open. There are a number of ideas that come up here that should be

Re: Python as Guido Intended

2005-11-24 Thread Simon Brunning
my first impulse is to think that one of decisions is wrong, nine times out of ten in time I'll come to find that I was wrong and he was right. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python as Guido Intended

2005-11-24 Thread Simon Brunning
he's made over many years. > > So, that makes that about a lot of things we think alike. Remains > the question about whose ideas are better about the things we > disagree. It might remain for *you* to see the answer to that question. I susp ect that most of us have answered it t

Re: Understanding Python Documentation

2005-11-24 Thread Simon Brunning
2.4.2/modindex.html which really isn't the same > thing at all. I think it is, really. Thing is, Python's standard library is broader and less nested in structure than Java's, so it stands to reason that its documetation will be broader and less nested in structur

Re: Python as Guido Intended

2005-11-24 Thread Simon Brunning
0% ? ;-) The other 10%, I've just not worked it out yet. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Python book for a non-programmer

2005-11-25 Thread Simon Brunning
biblio.org/obp/thinkCSpy/> Any recommendations, or otherwise? -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python book for a non-programmer

2005-11-25 Thread Simon Brunning
have thought either of those was suitable for a non-programmer. Great for cross-trainers, yes, but neither is intended as a programming tutorial. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: How to stop a linux process

2005-11-28 Thread Simon Brunning
I had control of the script, I can't think how I would stop timidity. > > Any advice on the 'area' of python I should be looking at would be greatly > appreciated. The subprocess module might be worth a look. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonlin

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-02 Thread Simon Brunning
On 12/2/05, Dave Hansen <[EMAIL PROTECTED]> wrote: > FWIW, indentation scoping one one of the features that _attracted_ me > to Python. +1 QOTW OK, it's a bit of a cliche. But it's a cliche because it's *true*. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.br

Re: Bitching about the documentation...

2005-12-07 Thread Simon Brunning
On 12/7/05, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > But none of them are the cost of Python, which is free. It really isn't a > scam, nobody is going to come knocking at your door with a surprise bill > for using Python. Well, there is the PSU's "Spanish Inquisition" division. Last week they

Re: ElementTree - Why not part of the core?

2005-12-07 Thread Simon Percivall
Before that can happen we'll need some better management of co-existing different versions of a package. You'll want to be able to use newer versions of external packages without breakage in the standard library. -- http://mail.python.org/mailman/listinfo/python-list

Re: first post: new to pythong. some questions.

2005-12-08 Thread Simon Brunning
.makeoneurl() See <http://docs.python.org/tut/node8.html> for why. (BTW, you would probably have got more of a response with a better subject line. <http://www.catb.org/~esr/faqs/smart-questions.html> is worth a read.) -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Bad Interpreter

2005-01-03 Thread Simon John
[EMAIL PROTECTED] wrote: > the script i have sock.py runs if i say something like : > > python sock.py > > but ./sock.py results in a :bad interpreter error > how do i troubleshoot something like this? sounds like you've been editting the script on a windows machine, and it's inserted it's evil l

Re: OT: spacing of code in Google Groups

2005-01-06 Thread Simon Brunning
On Wed, 05 Jan 2005 22:57:33 GMT, JanC <[EMAIL PROTECTED]> wrote: > Rectangular selection only works with the mouse in SciTE/Scintilla: > alt-click-drag. Nope - hold down alt-shift, and select with the cursor keys. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.ne

Re: python reading/writing ms-project files?

2005-01-07 Thread Simon Brunning
79003 for a very basic example of COM scripting. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: countint words from an input string

2005-01-07 Thread Simon Brunning
ome here, you might find it beneficial to run through the Python tutorial (at http://docs.python.org/tut/tut.html and included in the standard distribution), and to join the tutor mailing list (at http://mail.python.org/mailman/listinfo/tutor/). -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting rid of "self."

2005-01-07 Thread Simon Brunning
the 's' object is. The self prefix is a perfectly good convention. Let's stick to it. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Installation

2005-01-08 Thread Simon John
brolewis wrote: > I need to install Python on a number of laptop computers (at least a > dozen). I am needing to install Python 2.4, pycrypto, win32all, > wxPython, and pyCurl. You could try the recently-announced MOVPY, or NSIS/InnoSetup as you say. Or simply put the five installers on a disk -

Re: Game programming in Python

2005-01-11 Thread Simon Wittber
> I'm looking for any books or on-line resources on game programming > using Python. Does anyone have any advice? Hi Baza, If I you are as I assume, a programmer just starting out with game programming, the best suggestion I can give is head over to pygame.org, and after downloading and installi

Re: Python Installation

2005-01-12 Thread Simon Brunning
rg that was down, rather that the effbot himself. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Excel module for Python

2005-01-12 Thread Simon Brunning
, or in the Excel VBA help, which is an optional part of they Office installation. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ [1] http://starship.python.net/crew/mhammond/ [2] http://www.oreilly.com/catalog/pythonwin32/chapter/ch12.html [3] http://msdn.m

Re: Excel module for Python

2005-01-12 Thread Simon Brunning
7;d just build a CSV file if I were you. Excel opens them perfectly happily. If you need to write out formulae, formratting, that kind of thing, then I think you'll need to write a 'real' Excel file. I don't have a clue how to do that - sorry. -- Cheers, Simon B, [EMAIL PR

Release date for 2nd edn. Cookbook

2005-01-12 Thread Simon Foster
Does anyone have any idea on this date? Any chance of a signed copy for contributors? -- http://mail.python.org/mailman/listinfo/python-list

why are people still using classic classes?

2005-01-12 Thread Simon Wittber
I've noticed that a few ASPN cookbook recipes, which are recent additions, use classic classes. I've also noticed classic classes are used in many places in the standard library. I've been using new-style classes since Python 2.2, and am suprised people are still using the classic classes. Is th

Re: why are people still using classic classes?

2005-01-12 Thread Simon Wittber
> Is there a reason NOT to use them? If a classic class works fine, what > incentive is there to switch to new style classes? Perhaps classic classes will eventually disappear? It seems strange (and is difficult to explain to my peers) that a language offers two different ways to define a stand

Re: Unclear On Class Variables

2005-01-13 Thread Simon Brunning
at what happens with a mutable object: >>> class Spam(object): ... eggs = [3] ... >>> spam = Spam() >>> spam2 = Spam() >>> spam.eggs [3] >>> spam2.eggs [3] >>> spam.eggs.append(5) >>> spam.eggs [3, 5] >>> spam2.eggs [3, 5] -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: module on files & directories

2005-01-13 Thread Simon Brunning
.path.isdir() - <http://docs.python.org/lib/module-os.path.html>. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: why are people still using classic classes?

2005-01-13 Thread Simon Wittber
> Unfortunately, if we should follow the recent advice about > always using "super()" in the __init__ method, it's hard > to do what you suggest (though it sounds like good advice) > without resorting to extreme ugliness: 'import this' also provides some good advice: "There should be one-- and pr

Re: Unclear On Class Variables

2005-01-13 Thread Simon Brunning
On Thu, 13 Jan 2005 08:56:10 -0500, Peter Hansen <[EMAIL PROTECTED]> wrote: > Simon, it's really not about mutability at all. You've changed > the example, Err, there *wasn't* an example, not really. The OP just mentioned 'setting the values' of instance

Re: Octal notation: severe deprecation

2005-01-14 Thread Simon Brunning
ral. x = 04 # This doesn't need a warning: 04 == 4 #x = 09 # This doesn't need a warning: it will fail to compile x= 012 # This *does* need a warning: 012 == 10 -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Fuzzy matching of postal addresses

2005-01-18 Thread Simon Brunning
You might find these at least periperally useful: <http://www.brunningonline.net/simon/blog/archives/001291.html> <http://www.brunningonline.net/simon/blog/archives/001292.html> They refer to address formatting rather than de-duping - but normalising soulds like a useful firs

Re: lambda

2005-01-18 Thread Simon Brunning
ss is mutable and usable as dict key. Decimal objects are immutable, so far as I know. >>> from decimal import Decimal >>> spam = Decimal('1.2') >>> eggs = spam >>> eggs is spam True >>> eggs += 1 >>> eggs is spam False -- Cheer

Re: Python and Excel

2005-01-19 Thread Simon John
Hmm, sounds interesting, I've always resorted to using CSV (or even HTML!) when exporting to Excel. As far as how to open it up, have a look at creating a project on www.sourceforge.net or just zip it up and bung it on your own website if you have one. I've got the feeling there are also Python-sp

Re: map in Python

2005-01-21 Thread Simon Brunning
> test = ["a1", "a2", "a3"] > map(re.sub("[a-z]", ""), test) > print test This what you want? >>> import re >>> test = ["a1", "a2", "a3"] >>> test = [re.sub("[a-z]", "", item) for item in test] >>> test ['1', '2', '3'] -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: map in Python

2005-01-21 Thread Simon Brunning
On Fri, 21 Jan 2005 12:37:46 +, Simon Brunning <[EMAIL PROTECTED]> wrote: > This what you want? > > >>> import re > >>> test = ["a1", "a2", "a3"] > >>> test = [re.sub("[a-z]", "", item) for

Re: circular iteration

2005-01-21 Thread Simon Brunning
7;k'] > > for i in range(30): > print c[i%len(c)] I don''t know if it's faster, but: >>> import itertools >>> c=['r','g','b','c','m','y','k'] >>> for i in itertools.islice(itertools.cycle(c), 30): ... print i -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.1 - 2.4 differences

2005-01-24 Thread Simon Brunning
or the major changes, by release: * http://www.python.org/doc/2.2.3/whatsnew/ * http://www.python.org/doc/2.3/whatsnew/ * http://www.python.org/doc/2.4/whatsnew/ -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: "private" variables a.k.a. name mangling (WAS: What is print? A function?)

2005-01-25 Thread Simon Brunning
) feel that this is a more "Pythonic" approach. Give the programmer the information that they need, but don't try to stop them from doing what they need to do. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Question: "load"ing a shared object in python

2005-01-26 Thread Simon Brunning
e used? That too, given that the shared > object was written in c++, compiled with g++ ? Will ctypes do the trick? http://starship.python.net/crew/theller/ctypes/ -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: fast list lookup

2005-01-26 Thread Simon Brunning
# do whatever If the list is sorted, have a look at the bisect module. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Help With Python

2005-01-26 Thread Simon Brunning
.uk/python/> and <http://www.ibiblio.org/obp/thinkCSpy/>. Lastly, although neophytes are more than welcome here, you might find the tutor mailing list a good place to ask questions in the early days of your Python experience. You'll find it here - <http://mail.python.org

python memory blow out

2005-01-26 Thread Simon Wittber
I have written some software which proxy's SQL Server database services across a network. It uses Pyro, without multiuthreading. It creates and closes a new connection and cursor object for each request. Unfortunately, the memory consumption blows out (consuming all available memory) when a large

Re: Pystone benchmark: Win vs. Linux (again)

2005-01-28 Thread Simon John
Franco Fiorese wrote: > Is there any way, that you know, to get better performance under Linux? Build Python yourself, using relevant CFLAGS and TARGET for your processor? I've always noticed that Windows Python takes a lot longer to startup than Linux, but never really looked at runtime perform

Re: OT: why are LAMP sites slow?

2005-02-03 Thread Simon Wittber
> I notice that lots of the medium-largish sites (from hobbyist BBS's to > sites like Slashdot, Wikipedia, etc.) built using this approach are > painfully slow even using seriously powerful server hardware. Slow is such an ambiguous term. Do you mean the pages are slow to render in a browser, or

WYSIWYG wxPython "IDE"....?

2005-02-04 Thread Simon John
I'm writing my 2nd large wxPython program, and after the problems I found doing the first's layout in code, I'd like to look at using a 'WYSIWYG' IDE, like VisualStudio does for MFC. I've tried a few that I found, wxGlade is probably the best, although it seems to be not 100% WYSIWYG (like the wid

Re: how to operate the excel by python?

2005-06-20 Thread Simon Brunning
in' for further copyright information. >>> import win32com.client >>> excel = win32com.client.gencache.EnsureDispatch("Excel.Application") >>> win32com.client.constants.xlRight -4152 -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe problem

2005-06-21 Thread Simon Brunning
print >> mylog, exception # or whatever... You are free to ignore the exception altogether if you want to, but I promise you, you don't want to. ;-) -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get/set class attributes in Python

2005-06-21 Thread Simon Brunning
On 6/12/05, Steve Jorgensen <[EMAIL PROTECTED]> wrote: > Oops - I thought I cancelled that post when I relized I was saying nothing, Would that everyone cancelled their posts when they realised that they weren't saying anything. ;-) -- Cheers, Simon B, [EMAIL PR

Re: FAQ: __str__ vs __repr__

2005-06-21 Thread Simon Brunning
useful with it. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: getting an object name

2005-06-22 Thread Simon Brunning
itself cannot tell you its name, and it doesn't really care -- so the only way to find out what it's called is to ask all your neighbours (namespaces) if it's their cat (object) ... and don't be surprised if you'll find that it's known by many names, or no name at

Dr. Dobb's Python-URL! - weekly Python news and links (Jun 22)

2005-06-22 Thread Simon Brunning
QOTW: "Python is more concerned with making it easy to write good programs than difficult to write bad ones." - Steve Holden "Scientists build so that they can learn. Programmers and engineers learn so that they can build." - Magnus Lycka "It happens that old Java programmers make one module per

Dr. Dobb's Python-URL! - weekly Python news and links (Jun 22)

2005-06-22 Thread Simon Brunning
QOTW: "Python is more concerned with making it easy to write good programs than difficult to write bad ones." - Steve Holden "Scientists build so that they can learn. Programmers and engineers learn so that they can build." - Magnus Lycka "It happens that old Java programmers make one module per

Re: suggestions invited

2005-06-24 Thread Simon Brunning
to a remote syslogd, perhaps on your web server, and parse the > log file for the status data. QHST is similar to syslog - but what's an application host in 400 terms? -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Thoughts on Guido's ITC audio interview

2005-06-28 Thread Simon Brunning
t, but nevertheless I'm more productive with Python and SciTE than I am with Java and Eclipse. Eclipse helps a lot, true - I certainly wouldn't want to code Java without it or something like it - but it's not enought to pull ahead of Python's inherent superiority. -- Cheers, Simo

Re: Thoughts on Guido's ITC audio interview

2005-06-28 Thread Simon Brunning
or those IDE. Eclipse is indeed a memory hog of the first order. > 3. Python solve my problem. Mine too - but I'm not free to choose. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Modules for inclusion in standard library?

2005-06-29 Thread Simon Brunning
rning in the docs about the trouble you can get yourself into with it. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Dr. Dobb's Python-URL! - weekly Python news and links (Jun 29)

2005-06-29 Thread Simon Brunning
QOTW: "And what defines a 'python activist' anyway? Blowing up Perl installations worldwide?" - Ivan Van Laningham "Floating point is about nothing if not being usefully wrong." - Robert Kern Sibylle Koczian needs to sort part of a list. His first attempt made the natural mistake - sort

<    1   2   3   4   5   6   7   8   9   10   >