Re: yet another indentation proposal

2007-08-20 Thread Paddy
On Aug 19, 5:22 pm, [EMAIL PROTECTED] (Alex Martelli) wrote: > Paddy <[EMAIL PROTECTED]> wrote: > >... > > > Can screen reaaderss be customized? > > Open-source ones surely can (e.g., NVDA is an open-source reader for > Windows written in Python, <http:

Re: defaultdict of arbitrary depth

2007-08-21 Thread Paddy
() > > for k1,k2,k3,v in data: > table[k1][k2][k3] = v > > for kk in sorted(table.keys()): > print "-",kk > for jj in sorted(table[kk].keys()): > print " -",jj > for ii in sorted(table[kk][jj].keys()): > print "-",ii,table[kk][jj][ii] > > prints: > - A > - B > - Z 1 > - C > - X 3 > - Y 2 > - B > - A > - W 4 > - B > - U 6 > - V 5 > - D > - T 7 There is something here: http://groups.google.com/group/comp.lang.python/msg/92502e0278c2a56e - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: list index()

2007-08-31 Thread Paddy
'oll' in troll like the 'ol' in frolic, and pronounce roll and role similarly. My accent is probably from the East Midlands of the UK, but is not pronounced. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: pronounciation [was: list index()]

2007-08-31 Thread Paddy
On Aug 31, 11:19 am, Tim Golden <[EMAIL PROTECTED]> wrote: > Tim Golden wrote: > > Erik Max Francis wrote: > >> Paddy wrote: > > >>> I say the 'oll' in troll like the 'ol' in frolic, and pronounce roll > >>> and role similarly.

Way off topic

2007-09-01 Thread Paddy
On Sep 1, 7:40 am, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > "Paddy" wrote: > > > I say the 'oll' in troll like the 'ol' in frolic, and pronounce roll > > and role similarly. > > Same here - when the Troll lives under

Re: list index() (OT)

2007-09-01 Thread Paddy
e the excellent frolic example > He likes to Troll - rhymes with roll? > > - Hendrik No difference. A troll is a troll is a troll. :-) - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: list index() (OT) and definitely trolling :-)

2007-09-01 Thread Paddy
> Get on the web: Blog, lens and tag the Internet > Many services currently offer free registration > --- Thank You for Reading - Since the language that inspired the programming language is most definitely English as spoken in the UK, could it

Re: Text processing and file creation

2007-09-05 Thread Paddy
gt; 5 lines and creating new files until processing of all 20.000 lines is > done. > Is there an efficient way to do this in Python? > In advance, thanks for your help. If its on unix: use split. If its your homework: show us what you have so far... - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and CUDO

2007-09-07 Thread Paddy
less enigma > that is made terrible by our own mad attempt to interpret it as though it had > an underlying truth." > -- Umberto Eco Maybe you and the CorePy guys at http://www.corepy.org/ could swap notes and give us a similar way to work with these accellerators? - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Text processing and file creation

2007-09-07 Thread Paddy
On Sep 7, 3:50 am, George Sakkis <[EMAIL PROTECTED]> wrote: > On Sep 5, 5:17 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > If this was a code golf challenge, I'd choose the Unix split solution and be both maintainable as well as concise :-) - Paddy.

Re: Coming from Perl

2007-09-13 Thread Paddy
Just as an aside, you might find this helpful: http://wiki.python.org/moin/PerlPhrasebook It has perl code with python equivalents/notes. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Parallel/Multiprocessing script design question

2007-09-13 Thread Paddy
http://en.wikipedia.org/wiki/Sun_Grid_Engine and use JOB ARRAYS: http://docs.sun.com/app/docs/doc/820-0699/6nce0ht7s?l=en&a=view#i999498 - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Perl and Python, a practical side-by-side example.

2007-03-03 Thread Paddy
ividual > languages. Hi Shawn, there is a web page that gives examples from Perl's Datastructures Cookbook re-implemented in Python. It might be of help for future Python projects: http://wiki.python.org/moin/PerlPhrasebook - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Using string as file

2007-03-06 Thread Paddy
Thanks, > > Florian You can also look at example 3 here: http://en.wikipedia.org/wiki/Doctest#Example_3:_unique_words.py - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: minimum age to learn python (a.k.a graphical vs text languages)

2007-03-10 Thread Paddy
spend too much time yourself on the laptop with son in lap watching Hi-5 or a Wombles video, on screen-2. Currently Dominic and I are potty training. After that we'll start on decorators and maybe weakref. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: 2 new comment-like characters in Python to aid development?

2007-03-11 Thread Paddy
that lie around. > > -- > Nick Craig-Wood <[EMAIL PROTECTED]> --http://www.craig-wood.com/nick Vim will highlight the following comments too: #FIXME #TODO #XXX - Paddy -- http://mail.python.org/mailman/listinfo/python-list

Re: Signed zeros: is this a bug?

2007-03-11 Thread Paddy
ng one of two different vaues for an argument of zero is actually mathematically not a bad thing to do? - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Signed zeros: is this a bug?

2007-03-11 Thread Paddy
On Mar 11, 10:49 pm, "Paddy" <[EMAIL PROTECTED]> wrote: > On Mar 11, 9:28 pm, Paul Rubin <http://[EMAIL PROTECTED]> wrote: > > > Dennis Lee Bieber <[EMAIL PROTECTED]> writes: > > > >Pardon? What is "the right thing with signed zeros&

Re: When is List Comprehension inappropriate?

2007-03-20 Thread Paddy
gt; # some random ranges >>> data = [range(random.randrange(3,7)) for x in range(4)] >>> # but I want each range jumbled >>> [ random.shuffle(d) for d in data] [None, None, None, None] >>> data [[2, 0, 3, 1], [0, 2, 1], [3, 4, 1, 0, 2], [2, 1, 0, 3]] >>> (I do know how to re-write it). - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Wikipedia and a little piece of Python History

2007-03-21 Thread Paddy
ost a copy so that it could be linked to? Tim, would you object? - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Wikipedia and a little piece of Python History

2007-03-21 Thread Paddy
On Mar 21, 8:20 pm, [EMAIL PROTECTED] (John J. Lee) wrote: > "Paddy" <[EMAIL PROTECTED]> writes: > > I just had a link to Tim peters first post on doctest: > >http://groups.google.com/group/comp.lang.python/msg/1c57cfb7b3772763 > > removed fromhttp://en.wikipe

Re: When is List Comprehension inappropriate?

2007-03-21 Thread Paddy
On Mar 22, 4:56 am, [EMAIL PROTECTED] (Alex Martelli) wrote: > Paddy <[EMAIL PROTECTED]> wrote: > >... > > > I have found that I have gone too far when I used listcomps for their > > sideeffects rather than wanting the list produced, for example the > > I a

Re: Wikipedia and a little piece of Python History

2007-03-21 Thread Paddy
On Mar 21, 8:39 pm, Paul Rubin <http://[EMAIL PROTECTED]> wrote: > "Paddy" <[EMAIL PROTECTED]> writes: > > I just had a link to Tim peters first post on doctest: > >http://groups.google.com/group/comp.lang.python/msg/1c57cfb7b3772763 > > removed fr

Re: Wikipedia and a little piece of Python History

2007-03-21 Thread Paddy
On Mar 21, 10:31 pm, [EMAIL PROTECTED] (Cameron Laird) wrote: > In article <[EMAIL PROTECTED]>, > > > > Paddy <[EMAIL PROTECTED]> wrote: > >On Mar 21, 8:20 pm, [EMAIL PROTECTED] (John J. Lee) wrote: > >> "Paddy" <[EMAIL PROTECTED]> wr

Re: On text processing

2007-03-23 Thread Paddy
'value2', 'key3': 'value3', 'key4': 'value4', 'key5': 'value5', 'key6': 'value6', 'key7': 'value7', 'key8': 'value8'} >>> pp(matrices) {'key4': [['spec11', 'spec12', 'spec13', 'spec14'], ['spec21', 'spec22', 'spec23', 'spec24'], ['spec31', 'spec32', 'spec33', 'spec34']], 'key7': [['more11', 'more12', 'more13'], ['more21', 'more22', 'more23']]} >>> - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Modal value of an array

2007-03-28 Thread Paddy
operator >>> foo = ["spam", "eggs", "spam", "spam", "spam", "beans", "eggs"] >>> count = {} >>> for item in foo: count[item] = count.get(item, 0) +1 ... >>> maxitem = max(count.items(), key= operator.itemgetter(1)) >>> maxitem ('spam', 4) >>> I was trying to minimise the iterations through the list. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: make RE more cleaver to avoid inappropriate : sre_constants.error: redefinition of group name

2007-03-29 Thread Paddy
llowing: >>> s1 = '[EMAIL PROTECTED]' >>> s2 = '<[EMAIL PROTECTED]>' >>> matchobj = re.search(r'<(?P[EMAIL PROTECTED])>|(?P[EMAIL >>> PROTECTED])', s1) >>> matchobj.groupdict()['email1'] or matchobj.groupdi

Re: Modal value of an array

2007-03-29 Thread Paddy
"spam", "spam", "beans", "eggs"] > >>> max(foo, key=foo.count) > > 'spam' > > Alex This doesn't call foo.count for duplicate entries by keeping a cache >>> foo = ["spam", "eggs", "spam", "spam", "spam", "beans", "eggs"] >>> def cachecount(x, cache={}): ... return cache.setdefault(x, foo.count(x)) ... >>> max(foo, key=cachecount) 'spam' >>> cachecount.func_defaults ({'eggs': 2, 'beans': 1, 'spam': 4},) >>> - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Modal value of an array

2007-03-29 Thread Paddy
On Mar 30, 2:58 am, [EMAIL PROTECTED] (Alex Martelli) wrote: > Paddy <[EMAIL PROTECTED]> wrote: > >... > > > > > > A bit more directly: > > > > >>> foo = ["spam", "eggs", "spam", "spam", "spam&

Re: PyPy for dummies

2007-03-29 Thread Paddy
;s call > it - academic experiment, but also something very close to beeing usefull > at the level of the current CPython. > > -- > damjan It is also European funding for an open source project with sprints. I'm sure some eurocrat will be dissecting the project to see if it is aa good way to fund technical projects. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: make RE more cleaver to avoid inappropriate : sre_constants.error: redefinition of group name

2007-03-30 Thread Paddy
On Mar 30, 1:44 pm, "aspineux" <[EMAIL PROTECTED]> wrote: > On 30 mar, 00:13, "Paddy" <[EMAIL PROTECTED]> wrote: > > > On Mar 29, 3:22 pm, "aspineux" <[EMAIL PROTECTED]> wrote: > > > > I want to parse > > > >

Re: Modal value of an array

2007-03-30 Thread Paddy
On Mar 30, 10:17 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 29 Mar 2007 19:44:56 -0300, Paddy <[EMAIL PROTECTED]> > escribió: > > > On Mar 29, 8:49 am, [EMAIL PROTECTED] (Alex Martelli) wrote: > >> >>> foo = ["spam&quo

Re: reverse engineering Excel spreadsheet

2007-04-01 Thread Paddy
OOffice can save sheets in Sylk format which gives you a simple textual format for cells, including the equations. Can't think of any easier way with the macros other than hard slog! P.S. It is well to remember that the UK Tax department have a very low opinion of the quality of spreadsheets so if you find oddities remember to query them. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why NOT only one class per file?

2007-04-05 Thread Paddy
On Apr 5, 5:51 pm, John Nagle <[EMAIL PROTECTED]> wrote: > Nate Finch wrote: > > I think you're all going about this the wrong way. There's no reason > > to *always* have one class per file. However, there's also no reason > > to have 1600 lines of code and 50 classes in one file either. > >

Re: block scope?

2007-04-08 Thread Paddy
tent scope rules for listexps and genexps. Isn't it coming in 3.0? If it is, then maybe it will be back-ported to Python 2.6. In Python 2.5 we have the following: >>> [k for k in (j for j in range(5))] [0, 1, 2, 3, 4] >>> k 4 >>> j Traceback (most recent call last): File "", line 1, in NameError: name 'j' is not defined >>> - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: IPython 0.8.0 is out

2007-04-11 Thread Paddy
On Apr 11, 6:18 am, Fernando Perez <[EMAIL PROTECTED]> wrote: > Hi all, > > The IPython team is happy to release version 0.8.0, with a lot of new > enhancements, as well as many bug fixes. > > We hope you all enjoy it, and please report any problems as usual. > > WHAT is IPython? >

Re: Shebang or Hashbang for modules or not?

2007-04-11 Thread Paddy
re leave out the shebang/not set the execute bit to emphasise your intended use. During development however, intended use may differ from use when deployed. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: text file vs. cPickle vs sqlite a design question

2007-04-11 Thread Paddy
sts.append( [ #", i for tpl in l: print " ", tpl, "," print " ]) #", i You would then have your data saved in a format that could easily be re-used by other programs at a later date, and that can be examined in any text editor. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with algorithm

2007-04-13 Thread Paddy
ipe/502199 You could then write something like: import string for thiscomb in comb2( *([string.lowercase]*26) ): ... Mind you, it generates a lot of combinations. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python editor/IDE on Linux?

2007-04-13 Thread Paddy
do some > > development work on Linux and the distro I am using is Xubuntu. > > Everybody uses vim. Vim! (Oh great its been seconds since the last editor war). - Paddy ;-), -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Feature Request: Explicit variable declarations

2007-04-14 Thread Paddy
http://www.python.org/doc/faq/programming.html#is-there-a-tool-to-help-find-bugs-or-perform-static-analysis PyChecker and Pylint might help you. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python editor/IDE on Linux?

2007-04-14 Thread Paddy
lver Surfer. Edison. Max Planck Notepad user: G.W. Bush. See, it's clear! - Paddy ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Feature Request: Allow changing base of member indices to 1

2007-04-14 Thread Paddy
s in Python. http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html The author has done a bit: http://en.wikipedia.org/wiki/Dijkstra Having more than one index start point would be a maintenance nightmare best avoided. (It can be done in Perl). - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Feature Request: Allow changing base of member indices to 1

2007-04-14 Thread Paddy
On Apr 14, 8:55 pm, Sherm Pendley <[EMAIL PROTECTED]> wrote: > "Paddy" <[EMAIL PROTECTED]> writes: > > Having more than one index start point would be a maintenance > > nightmare best avoided. > > Quite right. > > > (It can be done in Perl). >

Re: Python Feature Request: Allow changing base of member indices to 1

2007-04-14 Thread Paddy
On Apr 15, 2:29 am, [EMAIL PROTECTED] (Alex Martelli) wrote: > Sherm Pendley <[EMAIL PROTECTED]> wrote: > > "Paddy" <[EMAIL PROTECTED]> writes: > > > > I don't think we should add it to Python > > > because it would make porting VB code

Re: function with list argument defaulting to [] - what's going on here???

2007-04-14 Thread Paddy
: > > if the function modifies the object (e.g. by appending an item to a > > list), the default value is in effect modified. > > This comes up so often that I wonder whether Python should issue a warning > when it sees [] or {} as a default argument. > > What d

Re: Getting started with python

2007-04-14 Thread Paddy
e a fair way through the Python tutorial though before you attempt thhem so you know the basics of Python first. On a different tack, from: http://tickletux.wordpress.com/2007/01/24/using-fizzbuzz-to-find-developers-who-grok-coding/ It seems you need to learn how to write a Fizz-Buzz program to get

Re: Python editor/IDE on Linux?

2007-04-15 Thread Paddy
On Apr 15, 9:33 am, "Daniel Gee" <[EMAIL PROTECTED]> wrote: > In Linux I just use Gedit. In windows I settle for Notepad2. With > python having help built into the interpreter, anything more than line > numbering, simple syntax highlighting, and auto-indent when you hit > enter just doesn't seem ne

Re: Python Feature Request: Allow changing base of member indices to 1

2007-04-15 Thread Paddy
p://www.texytipografia.com Hi Javier, You seem to have missed out array *indexing* in your argument, or is array indexing obsolete? - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python editor/IDE on Linux?

2007-04-16 Thread Paddy
he position you want to copy the text to. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Compare regular expressions

2007-04-16 Thread Paddy
= "|".join( r"(?P<__match_%i__>%s)" % (i, r) for i,r in enumerate(regexps) ) now if one of the regexps matches then the corresponding named group should have a non-empty string value. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

python-list@python.org

2007-04-16 Thread Paddy
also use count rather than the explicit loop to get something like: def multiremberandco1(el, seq, fun): l1, l2 = [], [] c = seq.count(e1) l1 = [el] * c l2 = [el] * (len(seq) - c) return fun(l1, l2) I don't have the book so can't comment on its suitability, but there you go. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Compare regular expressions

2007-04-17 Thread Paddy
On Apr 17, 9:17 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Paddy schrieb: > > > > > On Apr 16, 10:50 am, Thomas Dybdahl Ahle <[EMAIL PROTECTED]> wrote: > >> Hi, I'm writing a program with a large data stream to which modules can >

Re: Extended slicing and Ellipsis - where are they used?

2007-09-13 Thread Paddy
.. def __getitem__(self, i): > ... try: > ... return [list.__getitem__(self, j) for j in i] > ... except TypeError: > ... return list.__getitem__(self, i) > ... > py> b = Bob(xrange(15, 30)) > py> b[3, 5, 7, 13] > [18, 20, 22, 28] > > James And the ellipses ... ? - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

regexp search on infinite string?

2007-09-14 Thread Paddy
string object needed by re.search? - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: regexp search on infinite string?

2007-09-14 Thread Paddy
On Sep 15, 2:57 am, James Stroud <[EMAIL PROTECTED]> wrote: > Paddy wrote: > > Lets say i have a generator running that generates successive > > characters of a 'string' > >>From what I know, if I want to do a regexp search for a pattern of > >

Re: Extended slicing and Ellipsis - where are they used?

2007-09-14 Thread Paddy
On Sep 15, 12:29 am, James Stroud <[EMAIL PROTECTED]> wrote: > Paddy wrote: > > And the ellipses ... ? > > ;) > > py> class Bob(dict): > ... def __getitem__(self, k, *args, **kwargs): > ... if k is Ellipsis: > ... return sorted(self.keys())

Re: regexp search on infinite string?

2007-09-15 Thread Paddy
On Sep 14, 9:49 pm, Paddy <[EMAIL PROTECTED]> wrote: > Lets say i have a generator running that generates successive > characters of a 'string'>From what I know, if I want to do a regexp search > for a pattern of > > characters then I would have to &#

Re: regexp search on infinite string?

2007-09-15 Thread Paddy
On Sep 15, 2:07 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Sep 15, 10:56 pm, Paddy <[EMAIL PROTECTED]> wrote: > > > > > On Sep 14, 9:49 pm, Paddy <[EMAIL PROTECTED]> wrote: > > > > Lets say i have a generator running that generates successive

Re: How to assign a function to another function

2007-09-17 Thread Paddy
> > at the beginning of the body of assigner. > > This worked, thanks a lot :) > > -- > Stefano Esposito <[EMAIL PROTECTED]> I got this explained to me awhile back and blogged on it here: http://paddy3118.blogspot.com/2006/07/python-functions-assignments-and-scope.html - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Getting indented code snippets into blogger

2007-09-18 Thread Paddy
I got tired of Bloggers inadequate comment editor so wrote this for transforming code snippets: = ''' blogspace.py Turns leading spaces into HTML   tokens which shows as correct indentation on Blogger comment fields (and maybe other blogs). Donald. '

Re: Sets in Python

2007-09-19 Thread Paddy
ke a mathematical set. > > This is written as: > > a = set([1, 2, 3, frozenset([1, 2])]) > > > This is not related, but is there i neat way (without pop and list > > comprehension) to convert a set into a list? > > list(a) > > Raymond frozenset over turning the em

Re: Using pseudonyms

2007-09-19 Thread Paddy
is "Alessandro" (which > no American is ever going to be able to spell right -- ONE L, TWO S's, > NOT an X or a J instead, "DRO" ending rather than "DER", etc), might > choose to avoid the hassle and go by "Alex" (just to make up a case...). > >

Re: Sets in Python

2007-09-19 Thread Paddy
rogrammer a big problem hence the limitation. I don't think you have a better solution. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Sets in Python

2007-09-19 Thread Paddy
mplementation and you will find it is impractical. Checking for mutability then doing deep copies of keys and would consume time in something that greatly affects the speed of Python as a whole. Pythons designers give *you* the option of doing this and leave the underlying dict speedy. I can live wi

Re: how to convert xml file to word document.

2007-09-20 Thread Paddy
rgent now. > > Thanks, > prajwala XML to XHTML via XSLT ? - loads of X's but I'd slip Python and elementtree in there somewhere. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting rid of bitwise operators in Python 3?

2007-09-22 Thread Paddy
Sorry Carl, I think *you* may not have much need for bitwise operators but others, including myself do. No matter what the usage found, I would think replacing bitwise operators by function calls a retrograde step. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting rid of bitwise operators in Python 3?

2007-09-22 Thread Paddy
On Sep 22, 8:29 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > On Sat, 22 Sep 2007 14:50:12 +0000, Paddy wrote: > > Sorry Carl, > > I think *you* may not have much need for bitwise operators but others, > > including myself do. No matter what the usage found, I would

Re: Making a small change to a large XML document

2007-09-25 Thread Paddy
python 2.5.1. > > Thanks! If it was machine formatted, regular XML, on a unix box then I'd use sed: sed -e 's/value="9997"/value="zzz"/g;s/value="9998"/value="ZZZ"/g' \ infile > outfile It would work for what you said, but

Re: GUI for viewing/editing python data structures?

2007-09-27 Thread Paddy
. > The magic googling phrase is: Python bean-editor Which gave http://home.gna.org/oomadness/en/editobj/index.html I've never used it. Could you tell me how you get on? - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding behaviour for managing "task" dependencies

2007-10-02 Thread Paddy
know if I can extend a copy of it to do that. > > Mike You could use a professional Job scheduling system such as LSF or Suns Grid Engine that both support job dependencies (and a whole lot more). For example, search for 'Job Dependencies' on this page: http://docs.sun.com/app/docs/doc/820-0699/6nce0ht7s?a=view - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: best way of dealing with currency?

2007-10-16 Thread Paddy
On Oct 16, 8:29 pm, Paul Miller <[EMAIL PROTECTED]> wrote: > I'm looking at doing some currency calculations in some Python code > integrated with a C++ application. I want to be able to come up with the > same values I get in an Excel spreadsheet. Ouch! do really want to come up with the Excel re

Re: Newbi Q: Recursively reverse lists but NOT strings?

2007-10-16 Thread Paddy
> >story stargaming, I caught it first this time !-) Shouldn't that be s-o-r-r-y :-) > <*ot> -- http://mail.python.org/mailman/listinfo/python-list

Re: python project ideas

2007-10-25 Thread Paddy
gt; be complete in 2-3 months by 2-3 person group. > May be something useful for open source or python community ... > Well, just post what you think could be appropriate ... Is their anything left over from the last Google summer of code Python suggestions? - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: New to Vim and Vim-Python

2007-10-25 Thread Paddy
On Oct 24, 7:25 pm, Daniel Folkes <[EMAIL PROTECTED]> wrote: > I am new to using Vim's scripts. > > I was wondering if anyone uses Vim-Python and how to use it? This > includes things like key bindings and such. > > Thanks in advance, > Daniel Folkes > [EMAIL PROTECTED] You asked at the right ti

Re: why did these companies choose Tcl over Python

2007-10-31 Thread Paddy
industry was in some ways ahead of other industries in adopting TCL as its major scripting language but because of this I think it might now be suffering because, as capable as TCL is, current EDA tools would benefit from reflecting what is increasingly an object oriented compiled language core, as Python objects for user manipulation. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: permuting over nested dicts?

2007-10-31 Thread Paddy
7, 'y':10}} > and so forth? > > Any link or snippet is appreciated. > > TIA > Christian from http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/502199 import comb2 # (I wish)! for xa,ya,xb,yb in comb2([1,2,3], [4,5,6], [7,8,9], [10,11,12]): print {'a': {'x': xa, 'y': ya}, 'b': {'x': xb, 'y': yb}} Should work although untested. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: AOP and pep 246

2007-11-01 Thread Paddy
ows them to write a testbench in e and use AOP to extend it to create different testcases. Just found a version of the LRM online (search for 'extend'): http://www.ieee1647.org/downloads/prelim_e_lrm.pdf - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: An iterator with look-ahead

2007-01-10 Thread Paddy
makes > it fairly inconvenient to use. I guess another idea might be to > allow user to provide a "no peek" return value in the > constructor, if they so wish. > > -- > Neil Cerutti You could raise a different Exception, PeekPastEndEception ? - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: dot operations

2007-01-11 Thread Paddy
comprehensions? >>> a = (1, 2, 3, 4) >>> b = (4, 3, 2, 1) >>> import operator >>> c = map(operator.add, a, b) >>> c [5, 5, 5, 5] >>> c1 = [a1+b1 for a1,b1 in zip(a,b)] >>> c1 [5, 5, 5, 5] >>> - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

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

2007-01-20 Thread Paddy
s zero print some message and continue, then you would most likely do something like: x = 1 y = 0 try: z = x / y except ZeroDivisionError: print "This leads to a divide by zero error!" There is more info in the tutorial chapter 8. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is any python like linux shell?

2007-01-21 Thread Paddy
ll somebody please tell me if there are any python like shells > > for linux? > > IPython is actually more than a simple shell. Give it a try: > http://ipython.scipy.org/. > > George Frank, IPython is great, but it is not a replacement for a shell like bash. If you have a Linux

Re: Best way to document Python code...

2007-01-22 Thread Paddy
matically keep the use cases up-to-date. http://en.wikipedia.org/wiki/Doctest - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: The reliability of python threads

2007-01-24 Thread Paddy
helps > me focus my efforts. > > -carl Three to four months before `strange errors`? I'd spend some time correlating logs; not just for your program, but for everything running on the server. Then I'd expect to cut my losses and arrange to safely re-start the program every TWO months. (I'd arrange the re-start after collecting logs but before their analysis. Life is too short). - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: The reliability of python threads

2007-01-25 Thread Paddy
On Jan 25, 9:26 am, [EMAIL PROTECTED] (Nick Maclaren) wrote: > In article <[EMAIL PROTECTED]>,"Paddy" <[EMAIL PROTECTED]> writes:|> > |> Three to four months before `strange errors`? I'd spend some time > |> correlating logs; not just for your pr

Re: The reliability of python threads

2007-01-25 Thread Paddy
On Jan 25, 7:36 pm, [EMAIL PROTECTED] (Nick Maclaren) wrote: > In article <[EMAIL PROTECTED]>,"Paddy" <[EMAIL PROTECTED]> writes:|> > |> > |> Three to four months before `strange errors`? I'd spend some time > |> > |> correlating logs;

Re: The reliability of python threads

2007-01-25 Thread Paddy
On Jan 25, 8:00 pm, Paul Rubin <http://[EMAIL PROTECTED]> wrote: > "Paddy" <[EMAIL PROTECTED]> writes: > > No, you should think of the service that needs to be up. You seem to be > > talking about how it can't be fixed rather than looking for ways to >

Re: The reliability of python threads

2007-01-26 Thread Paddy
On 26 Jan, 09:05, [EMAIL PROTECTED] (Nick Maclaren) wrote: > In article <[EMAIL PROTECTED]>,[EMAIL PROTECTED] writes:|> > |> What makes you think Paddy indicated he wouldn't try to solve the problem? > |> Here's what he wrote: > |> > |> What I&

Re: data design

2007-01-30 Thread Paddy
ion both easy, and able >to spot errors in text data? > > Last, but not least: is there a python lib implementing at least part > of this dream? Google for YAML and JSON formats too. http://www.yaml.org/ http://www.json.org/ -Paddy -- http://mail.python.org/mailman/listinfo/python-list

Re: how to "free" an object/var ?

2007-01-30 Thread Paddy
etion of an object even > if it is in use. This is a Good Thing. > > -- > Steven D'Aprano The folowing will make the data available for garbage collection no matter what references it: >>> l = ["data"] *10 >>> l ['data', 'data', 'data', 'data', 'data', 'data', 'data', 'data', 'data', 'data'] >>> l2 = l >>> l[:] = [] >>> l2 [] >>> - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Conditional expressions - PEP 308

2007-01-30 Thread Paddy
'res2:', res > > if __name__ == '__main__': >main() > > Result: > [Dbg]>>> > res1: pqrs > res2: abcdefjklpqrs But to give them credit though, in Whats new in Python 2.5: PEP 308, they do mention that as a matter of style you should parenthesise the if-expression, and the example given consistes of just a simple assignment of the if-expr to a name. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to "free" an object/var ?

2007-01-31 Thread Paddy
On Jan 31, 7:34 am, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Tue, 30 Jan 2007 23:22:52 -0800, Paddy wrote: > >> As far as I know there is no way to force the deletion of an object > >> even if it is in use. This is a Good Thing. > > >> -- >

Re: Sorting a List of Lists

2007-01-31 Thread Paddy
, 0, 1 > > You may want to use sorted(iterable, cmp=None, key=None, reverse=False) > if you don't want to sort in-place. > > Also, using comparison functions is usually not the most efficient way > to do such a sort. In your case, I'd go for a good old > Decora

Re: how to "free" an object/var ?

2007-01-31 Thread Paddy
On Feb 1, 1:45 am, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Wed, 31 Jan 2007 09:26:46 -0800, Paddy wrote: > > On Jan 31, 7:34 am, Steven D'Aprano <[EMAIL PROTECTED]> > > wrote: > > [snip] > > >> -- > >> Steven D'Aprano &g

Re: division by 7 efficiently ???

2007-01-31 Thread Paddy
a minus or division operator in sight ;-) - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie/ merging lists of lists with items in common

2007-02-02 Thread Paddy
: python Python 2.5 (r25:51908, Nov 28 2006, 16:10:01) [GCC 3.4.3 (TWW)] on sunos5 Type "help", "copyright", "credits" or "license" for more information. >>> from pprint import pprint as pp >>> from collections import defaultdict >>> data = [['a', '13'], ['a', '3'], ['b', '6'], ['c', '12'], ['c', '15'], >>> ['c', '4'], ['d', '2'], ['e', '11'], ['e', '5'], ['e', '16'], ['e', '7']] >>> d = defaultdict(list) >>> _ = [d[x0].append(x1) for x0,x1 in data] >>> pp(d) defaultdict(, {'a': ['13', '3'], 'c': ['12', '15', '4'], 'b': ['6'], 'e': ['11', '5', '16', '7'], 'd': ['2']}) >>> pp(sorted(d.items())) [('a', ['13', '3']), ('b', ['6']), ('c', ['12', '15', '4']), ('d', ['2']), ('e', ['11', '5', '16', '7'])] >>> - Paddy -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie/ merging lists of lists with items in common

2007-02-02 Thread Paddy
On Feb 2, 2:39 pm, "Paddy" <[EMAIL PROTECTED]> wrote: > On Feb 2, 1:55 pm, "ardief" <[EMAIL PROTECTED]> wrote: > > > > > Hi everyone > > Here is my problem: > > I have a list that looks like this - > > [['a', '13&#

Re: newbie/ merging lists of lists with items in common

2007-02-02 Thread Paddy
On Feb 2, 10:34 pm, [EMAIL PROTECTED] wrote: > Paddy: > > >>> _ = [d[x0].append(x1) for x0,x1 in data] Yep, definitely a case of overdoing the list comprehensions when you throw away the list. I'll watch out for that in the future, Ta. - Paddy. > > I think that yo

Re: from... import...

2007-02-02 Thread Paddy
http://www.ferg.org/projects/python_java_side-by-side.html http://dirtsimple.org/2004/12/python-is-not-java.html Happy coding - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: main

2007-02-02 Thread Paddy
, when the file is normally imported as a module. > and what is > __name__ > __main__ > > use for in terms of Java? > With respect, (hehe), maybe you need to indicate that you've searched the Python documentation on __name__ and __main__? (Hah! I did that without saying R

<    1   2   3   4   5   6   7   >