Rate my reply

2006-10-20 Thread Paddy
out to critique the replies. I'm interested in what the group think makes a good comp.lang.python reply: too short, too long; too cryptic, too simplistic, too polite (is their such a thing), too nasty; too self-effacing, too self-promoting; too long a sig ;-) , too anonymous ... Paddy

Re: implementation of "in" that returns the object.

2006-10-23 Thread Paddy
inref(val, lst): ... try: ... return lst[ lst.index(val) ] ... except ValueError: ... return False ... >>> z = inref(y, x) >>> z [1] >>> z[0] = 33 >>> z [33] >>> x [[0], [33], [2]] Hope this helps - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to identify generator/iterator objects?

2006-10-25 Thread Paddy
effect? itertools doesn't seem to have anything that > will do it. > > Thanks, > Ken >>> def f(x): ... for s in x: yield s ... >>> f([1]) ? - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Any way of adding methods/accessors to built-in classes?

2006-10-25 Thread Paddy
irritation Ken, if you have to maintain code, as I do/have done, then you remember how many times little inconsistencies have tripped you up in the past, and offset those gripes against things like this. - cheers, Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to identify generator/iterator objects?

2006-10-26 Thread Paddy
s in x: yield s ... >>> is_generator(f) True >>> # But look at the following: >>> def f2(x): ... def g(y): ... for s in y: yield s ... return g(x) ... >>> f2([1,2,3]) >>> is_generator(f2) False >>> ;-) - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Sentinel values for special cases

2006-10-26 Thread Paddy
s _Sentinel(object): ' Initial data value when true data has not been fetched/computed yet' pass NO_DATA = _Sentinel def xyz(a,b,c): if a == NO_DATA: # go get a (Hmm, should that be double underscores on _Sentinel ...). - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Search & Replace

2006-10-26 Thread Paddy
DataSmash wrote: > Hello, > I need to search and replace 4 words in a text file. > Below is my attempt at it, but this code appends > a copy of the text file within itself 4 times. > Can someone help me out. > Thanks! > > # Search & Replace > file = open("text.txt", "r") > text = file.read() > fil

Re: Regular Expression help for parsing html tables

2006-10-29 Thread Paddy
t; > Steve. Might searching the output of BeautifulSoup(html).prettify() make things easier? http://www.crummy.com/software/BeautifulSoup/documentation.html#Parsing%20HTML - Paddy -- http://mail.python.org/mailman/listinfo/python-list

Re: enumerate improvement proposal

2006-10-30 Thread Paddy
Just add one to indices where appropriate, buy her chocolates. Don't say a thing when you squelch your seventh off-by-one error. Look interested in the shoe store. (even for the fifth shoe, of the third store). - *Your partner does vi* Whoa! - Paddy :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Style for modules with lots of constants

2006-11-01 Thread Paddy
Neil Cerutti wrote: > The Glk API (which I'm implementing in native Python code) > defines 120 or so constants that users must use. The constants > already have fairly long names, e.g., gestalt_Version, > evtype_Timer, keycode_PageDown. > > Calls to Glk functions are thus ugly and tedious. > >

Re: Best way to have intermediate object description format

2006-11-02 Thread Paddy
why I put XML first :-) P.P.S. And UML seems to be about pretty diagrams rather than a textual format, but no doubt, with the size of the companies behind it, there's probably a textual format hidden in their too. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to have intermediate object description format

2006-11-03 Thread Paddy
[EMAIL PROTECTED] wrote: > Thanks paddy, Since the original language from which I am translating > does not support any of these formats, I will have to write one myself. > So, which one is easy to write out in a C like environment. > > regards, > Suresh > Paddy wrote: > &

Re: WSDL?

2006-11-03 Thread Paddy
tobiah wrote: > Is WSDL the right answer for in house communication > between programs written in different languages, or > is it more for publishing interfaces for use by parties > outside your own company? > > What else is available for sharing complex structures > with processes running program

Re: profanity on comp.lang.python (was Re: Pyro stability)

2006-11-08 Thread Paddy
hat do, would not do so when they want to impress, or communicate with a stranger. The tone of comp.lang.python *is* an asset, I think, to Python that swearing will diminish. - Paddy. P.S. I did a google search and found 540,000 hits for python in c.l.p. and only 121 for f***. thats less than one in a thousand. Lets keep it that way please. -- http://mail.python.org/mailman/listinfo/python-list

Re: decorators

2006-11-08 Thread Paddy
John Henry wrote: > I must be very thick. I keep reading about what decorators are and I > still don't have a good feel about it. See, for example: > > http://alex.dojotoolkit.org/?p=564 > > and: > > http://soiland.no/software/decorator > > What exactly do I use decorators for? Here's my learnin

Re: how is python not the same as java?

2006-11-09 Thread Paddy
nd write implementations in both languages yourself. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: reduce to be removed?

2006-11-11 Thread Paddy
Dustan wrote: > Anyway, I figured out a way to get the builtin > function 'sum' to work as I need: > sum([[1,2,3],[4,5,6],[7,8,9]], []) > Hah! No-one expects sum to be used on anything but numbers. Except lists as above. No-one expects sum to be used on anything but numbers, and maybe lists t

Re: Python development time is faster.

2006-11-13 Thread Paddy
Chris Brat wrote: > I've seen a few posts, columns and articles which state that one of the > advantages of Python is that code can be developed x times faster than > languages such as <>. > > Does anyone have any comments on that statement from personal > experience? > How is this comparison mea

Re: refactoring so that multiple changes can be made with one variable?

2006-11-14 Thread Paddy
stances = [] def __init__(self, name, strength, dexterity, intelligence): instances.append(self) # as before ... def mod_instances(self): for inst in instances: inst.some_property += 1 # or whatever # (Untested) - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: multi split function taking delimiter list

2006-11-14 Thread Paddy
, preferably without regexp? > > Thanks. > > Martin I resisted my urge to use a regexp and came up with this: >>> from itertools import groupby >>> s = 'apple=blue+cart' >>> [''.join(g) for k,g in groupby(s, lambda x: x in '=+'

Re: multi split function taking delimiter list

2006-11-14 Thread Paddy
Paddy wrote: > [EMAIL PROTECTED] wrote: > > > Hi, I'm looking for something like: > > > > multi_split( 'a:=b+c' , [':=','+'] ) > > > > returning: > > ['a', ':=', 'b', '+', '

Re: refactoring so that multiple changes can be made with one variable?

2006-11-14 Thread Paddy
John Salerno wrote: > Paddy wrote: > > > You could keep a handle on all object instances created then go through > > the objects making appropriate changes, e.g: > > > > > > class Character(object): > > instances = [] > > def __init

Re: multi split function taking delimiter list

2006-11-15 Thread Paddy
Paddy wrote: > Paddy wrote: > > > [EMAIL PROTECTED] wrote: > > > > > Hi, I'm looking for something like: > > > > > > multi_split( 'a:=b+c' , [':=','+'] ) > > > > > > returning: > >

Re: python and accessibility issues.

2006-11-16 Thread Paddy
links to their forums which might be able to provide you with more information. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: (mostly-)POSIX regular expressions

2006-05-28 Thread Paddy
maybe this: http://www.pcre.org/pcre.txt and ctypes might work for you? (I was suprised to find out that PCRE supported POSIX but don't know what version it supports or how well). - Pad -- http://mail.python.org/mailman/listinfo/python-list

Re: Any other config parsing modules besides ConfigParser ?

2006-05-29 Thread Paddy
ConfigObj? http://www.voidspace.org.uk/python/configobj.html - Pad. -- http://mail.python.org/mailman/listinfo/python-list

Re: TSV to HTML

2006-05-31 Thread Paddy
Brian wrote: > First let me say that I appreciate the responses that everyone has > given. > > A friend of mine is a ruby programmer but knows nothing about python. > He gave me the script below and it does exactly what I want, only it is > in Ruby. Not knowing ruby this is greek to me, and I woul

Re: grouping a flat list of number by range

2006-06-01 Thread Paddy
;>> def interv2(inlist): ... for i,val in enumerate(inlist): ... if i==0: ... tmp = val ... elif val != valinc: ... yield [tmp, valinc] ... tmp = val ... valinc = val+1 ... yield [tmp, valinc] ... >>> list(interv2(inlist)) [[3, 4], [6, 9], [12, 14], [15, 16]] === END interv2 === - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: grouping a flat list of number by range

2006-06-01 Thread Paddy
I did a little re-arranging of the generator version: def interv3(inlist): tmp = inlist[0] valinc = tmp+1 for val in inlist[1:]: if val != valinc: yield [tmp, valinc]; tmp = val valinc = val+1 yield [tmp, valinc] -- http://mail.python.org/m

Re: grouping a flat list of number by range

2006-06-01 Thread Paddy
Jim Segrave wrote: > In article <[EMAIL PROTECTED]>, > Paddy <[EMAIL PROTECTED]> wrote: > >=== interv2 === > >>>> def interv2(inlist): > >... for i,val in enumerate(inlist): > >... if i==0: > >...

Re: grouping a flat list of number by range

2006-06-01 Thread Paddy
Jim Segrave wrote: > In article <[EMAIL PROTECTED]>, > Paddy <[EMAIL PROTECTED]> wrote: > > > >What I ran was more like the version below, but i did a quick > >separation of the line that has the ';' in it and goofed. > > > >>

Re: grouping a flat list of number by range

2006-06-02 Thread Paddy
John Machin wrote: > On 2/06/2006 8:36 AM, Paddy wrote: > > Oh the siren call of every new feature in the language! > enumerate() just to get a first-time test, and then botch it?? > > Read the following; the replacement version uses a simple old-fashioned > inelegant flag

Re: Sampling a population

2006-06-02 Thread Paddy
Brian Quinlan wrote: > This is less a Python question and more a optimization/probability > question. Imaging that you have a list of objects and there frequency in > a population e.g. > > lst = [(a, 0.01), (b, 0.05), (c, 0.50), (d, 0.30), (e, 0.04), (f, 0.10)] > > and you want to drawn n items fro

Re: a good programming text editor (not IDE)

2006-06-15 Thread Paddy
John Salerno wrote: > I know there's a request for a good IDE at least once a week on the ng, > but hopefully this question is a little different. I'm looking for > suggestions for a good cross-platform text editor (which the features > for coding, such as syntax highlighting, etc.) but not a full

Re: Regular expression for not-group

2006-06-15 Thread Paddy
t match next. This is a negative lookahead assertion. For example, Isaac (?!Asimov) will match 'Isaac ' only if it's not followed by 'Asimov'. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular expression for not-group

2006-06-15 Thread Paddy
P.S. kodos might help you: http://kodos.sourceforge.net/ - Pad. -- http://mail.python.org/mailman/listinfo/python-list

Re: a good programming text editor (not IDE)

2006-06-17 Thread Paddy
oes syntax hilighting for Python and code foding. http://cream.sourceforge.net/ - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: code is data

2006-06-17 Thread Paddy
Anton Vredegoor wrote: > With the inclusion of ElementTree (an XML-parser) in Python25 and recent > developments concerning JSON (a very Pythonesque but somewhat limited > XML notation scheme, let's call it statically typed XML) > Your thoughts please. > > Anton Hi Anton. If you mean this JSON: h

Re: code is data

2006-06-18 Thread Paddy
esign your own DSL before long you start to embellish it with more statements or datatypes and before long it becomes complex. If you used Python from the beginning then you would have a community for support. I know the arguments, but every once in a while I think if only I could craft

Re: Seeking regex optimizer

2006-06-18 Thread Paddy
Kay Schluehr wrote: > I have a list of strings ls = [s_1,s_2,...,s_n] and want to create a > regular expression sx from it, such that sx.match(s) yields a SRE_Match > object when s starts with an s_i for one i in [0,...,n]. There might > be relations between those strings: s_k.startswith(s_1) ->

Re: Seeking regex optimizer

2006-06-18 Thread Paddy
Kay Schluehr wrote: > with reverse sorting as in your proposal.The naive solution is easy to > generate but I'm sceptical about its cost effectiveness. On the other > hand I do not want to investigate this matter if somebody else already > did it thoroughly. > > Regards, > Kay Hi Kay, The only wa

Re: Running DocTest on Strings

2006-06-29 Thread Paddy
notanotheridiot wrote: > Hi, > I have two strings - a docstring containing doctests and a code string > containing code to be tested with those doctests. I've been trying for > a day now to run the test without concatenating the two strings, > adding: > > import doctest > doctest.testmod > > to th

Re: beautifulsoup .vs tidy

2006-07-01 Thread Paddy
bruce wrote: > hi... > > never used perl, but i have an issue trying to resolve some html that > appears to be "dirty/malformed" regarding the overall structure. in > researching validators, i came across the beautifulsoup app and wanted to > know if anybody could give me pros/cons of the app as i

Re: Dictionary .keys() and .values() should return a set [with Python 3000 in mind]

2006-07-02 Thread Paddy
n try >>> # False in [d[k[i]] == v[i] for i in range(n)] The order of keys() and the order of values() are related, so a change to returning sets would also loose this functionality. Mind you, Never rely on that implied ordering. Always use items(). And so *if* sets were returne

PyPy and constraints

2006-07-02 Thread Paddy
ython, and wether the the algorithms used could handle the kind of use mentioned here: http://groups.google.com/group/comp.lang.python/browse_frm/thread/d297170cfbf1bb34/d4773320e3417d9c?q=constraints+paddy3118&rnum=3#d4773320e3417d9c Thanks, Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: PyPy and constraints

2006-07-02 Thread Paddy
Ziga Seilnacht wrote: > Paddy wrote: > > I followed the recent anouncement of version 0.9 of PyPi and found out > > that there was work included on adding constraint satisfaction solvers > > to PyPy: > > http://codespeak.net/pypy/dist/pypy/doc/howto-logicobjs

Re: PyPy and constraints

2006-07-03 Thread Paddy
Paddy wrote: > Ziga Seilnacht wrote: > > Paddy wrote: > > > I followed the recent anouncement of version 0.9 of PyPi and found out > > > that there was work included on adding constraint satisfaction solvers > > > to PyPy: > > > http://codespeak.n

Scope, type and UnboundLocalError

2006-07-09 Thread Paddy
Hi, I am trying to work out why I get UnboundLocalError when accessing an int from a function where the int is at the global scope, without explicitly declaring it as global but not when accessing a list in similar circumstances. The documentation: http://docs.python.org/ref/naming.html does not g

Re: Scope, type and UnboundLocalError

2006-07-09 Thread Paddy
Frank Millman wrote: > Paddy wrote: > > Hi, > > I am trying to work out why I get UnboundLocalError when accessing an > > int from a function where the int is at the global scope, without > > explicitly declaring it as global but not when accessing a list i

Re: Scope, type and UnboundLocalError

2006-07-09 Thread Paddy
Bruno Desthuilliers wrote: > Frank Millman a écrit : > > Paddy wrote: > > > >>Hi, > >>I am trying to work out why I get UnboundLocalError when accessing an > >>int from a function where the int is at the global scope, without > >>explicitly decl

Re: Scope, type and UnboundLocalError

2006-07-09 Thread Paddy
Paddy wrote: > > So, > An assignment statement may assign an object to a name, in which case > the name is 'tagged' as being local, > An assignment statement may mutate a mutable object already bound to a > name, in which case the assignment will not 'tag' t

Re: language design question

2006-07-09 Thread Paddy
less good at solving prolblems in the first languages way. Googling for Python Anagram, brought up http://www.voidspace.org.uk/python/nanagram.html#demo-version maybe you should look at the source code to nanagram for comparison. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Scope, type and UnboundLocalError

2006-07-09 Thread Paddy
Bruno Desthuilliers wrote: > Paddy a écrit : > > Bruno Desthuilliers wrote: > > > >>Frank Millman a écrit : > >> > >>>Paddy wrote: > >>> > >>> > >>>>Hi, > >>>>I am trying to work out why I get

Re: Scope, type and UnboundLocalError

2006-07-09 Thread Paddy
Dennis Lee Bieber wrote: > On 9 Jul 2006 11:30:06 -0700, "Paddy" <[EMAIL PROTECTED]> declaimed > the following in comp.lang.python: > > > So, > > An assignment statement may assign an object to a name, in which case > > the name is 'tagged'

Re: Scope, type and UnboundLocalError

2006-07-09 Thread Paddy
Fredrik Lundh wrote: > Paddy wrote: > > > ... irrelevant as in 'although only mutable objects can have their > > state modified; if n has a mutable value but the assignment statement > > changed n to refer to another object, then the name would be tagged as > >

Re: Scope, type and UnboundLocalError

2006-07-09 Thread Paddy
Bruno Desthuilliers wrote: Ta. -- http://mail.python.org/mailman/listinfo/python-list

Re: sum and strings

2006-08-25 Thread Paddy
Paddy wrote: <> > Why not make sum work for strings too? > > It would remove what seems like an arbitrary restriction and aid > duck-typing. If the answer is that the sum optimisations don't work for > the string datatype, then wouldn't it be better to put a t

Re: avoiding file corruption

2006-08-27 Thread Paddy
tinal value to the locking field. 8. Close and flush the file to disk. I have left what to do if a process has locked the file for too long as a simple exercise for you ;-). - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Middle matching - any Python library functions (besides re)?

2006-08-27 Thread Paddy
se data later in the flow to more easily extract the info you want? > > TIA for bearing with my ignorance of the clear solution I'm surely > blind to... > > EP Just some questions that I woud ask myself if given the task. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python style: to check or not to check args and data members

2006-09-01 Thread Paddy
to write and fit into the unit test framework if needed. http://en.wikipedia.org/wiki/Doctest - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: python loops

2006-09-01 Thread Paddy
Putty wrote: > In C and C++ and Java, the 'for' statement is a shortcut to make very > concise loops. In python, 'for' iterates over elements in a sequence. > Is there a way to do this in python that's more concise than 'while'? > > C: > for(i=0; i > > python: > while i < length: >

Re: Python style: to check or not to check args and data members

2006-09-01 Thread Paddy
Joel Hedlund wrote: > > You might try doctests, they can be easier to write and fit into the > > unit test framework if needed. > > While I firmly believe in keeping docs up to date, I don't think that > doctests alone can solve the problem of maintaining data integrity in > projects with more com

Re: why have to "from compiler import *"

2006-09-05 Thread Paddy
-/ |moduleFunc1 | |moduleVar2 | | | /-\ from module1 import moduleClass1 as C1 # namespace becomes \-----/ |C1 |# C1 === module1.moduleClass1 | | /-\ - Paddy.

Re: why have to "from compiler import *"

2006-09-05 Thread Paddy
Duncan Booth wrote: > "Paddy" <[EMAIL PROTECTED]> wrote: > > > > > import module1 > > # namespace becomes: > >\-/ > > |module1.moduleFunc1 | > > |module1.moduleClass1: | > > | class1M

Re: Positive lookahead assertion

2006-09-07 Thread Paddy
lse` is enclosed by (?=...) The regular expression engine will surreptitiously check that 'something else' does indeed follow, before returning any match of 'something'. Unfortunatley the above may be just as hard to decipher as the original ;-) - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Positive lookahead assertion

2006-09-07 Thread Paddy
gsomething else').span() (1, 10) >>> re.search(r'somethingsomething else', ' somethingsomethingsomething >>> else').span() (10, 33) >>> re.search(r'something(something else)', ' somethingsomethingsomething >>> else').span() (10, 33) >>> re.search(r'something(?=something else)', ' somethingsomethingsomething >>> else').span() (10, 19) >>> - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Positive lookahead assertion

2006-09-07 Thread Paddy
Paddy wrote: > tobiah wrote: > > >> Posted via a free Usenet account from http://www.teranews.com > > > Its all about context. If you want to match something but only if it > > > precedes something else, then you follow the regular expression for > > >

Re: Negation in regular expressions

2006-09-07 Thread Paddy
split the string if the delimiter was > more than one char long (say 'XYZ') ? [yes, I'm aware of re.split, but > that's not the point; this is just an example. Besides re.split returns > a list, not an iterator] > > George If your wiling to use groups then the fo

Re: Negation in regular expressions

2006-09-07 Thread Paddy
Paddy wrote: > George Sakkis wrote: > > It's always striked me as odd that you can express negation of a single > > character in regexps, but not any more complex expression. Is there a > > general way around this shortcoming ? Here's an example to illustrate a >

Re: Function metadata (like Java annotations) in Python

2006-09-10 Thread Paddy
#x27;t > uncover? > > Thanks! > Ori. I wrote up my investigation into function attributes and decorators on my blog: http://paddy3118.blogspot.com/2006/05/python-function-attributes.html http://paddy3118.blogspot.com/2006/05/function-attributes-assigned-by.html What do you think? - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get the "longest possible" match with Python's RE module?

2006-09-11 Thread Paddy
> > I want to know if there is some way to make Python RE behave like grep > does, or do I have to change to another engine? Maybe if you posted a (tested) grep example and data, that does as you want, the group could better understand what you are asking for? - Paddy.

Re: Are Python's reserved words reserved in places they dont need to be?

2006-09-12 Thread Paddy
a,*,;,... in them. It might be best to assume that column headings might end up with any arbitrary unicode character string and program from that. If the OP knows the full extent of his input data and knows that column names are valid identifiers PLUS Python reserved words then yes, It stops him from autogenerating identifiers in tht way - but others in this thread have suggested work-arounds. And yes, Python is not perfect, but its sweet spot is oh so tasty :-) (Which also applies to AWK, for a different sweet flavour) - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: min() & max() vs sorted()

2006-09-15 Thread Paddy
> for symmetry (my personal preference). Strange, but I've never thought of min and max in the way you do. If anything I think of them as being distinct from sort; a way to get the appropriate values without going to the bother of a full sort. After doing my excercises on implementing sort

Re: Looking for a python IDE

2006-09-16 Thread Paddy
ommon question. Please search out previous threads on this topic in comp.lang.python or search www.python.org, or do a general google around. You should find a LOT of opinion. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: tcl list to python list?

2006-09-16 Thread Paddy
ECTION00514) Then write a TCL function to traverse your TCL list and write it out in the python format. Another suggestion might be to use CSV as an intermediary: http://tcllib.sourceforge.net/doc/csv.html http://docs.python.org/dev/lib/module-csv.html Now if you know Python

Re: Pythondocs.info : collaborative Python documentation project

2006-09-16 Thread Paddy
for contributing to the official documentation? Personally, I thought it was OK back in 199 but I did program in several other languages, including scripting languages, before Python. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: tcl list to python list?

2006-09-17 Thread Paddy
be so forward as to edit for readability > (I think a list comprehension to build the actual list is easier to follow > than the for loop with the strangely-indented comments): > > # Create a single Tcl interpretive context for all the work. > tk_instance = Tkinter.Tk().tk.eval > &g

Re: Code Golf Challenge : 1,000 Digits Of Pi

2006-09-18 Thread Paddy
Carl Drinkwater wrote: > For those who haven't heard of codegolf.com, it can be described as > "allowing you to show off your code-fu by trying to solve coding > problems using the least number of keystrokes." Is having good 'code-fu' worthwhile? It may be trivial to score but do the results show

Re: Code Golf Challenge : 1,000 Digits Of Pi

2006-09-18 Thread Paddy
Paul McGuire wrote: > Success lies in the journey, not the destination. > > or in Yoda-speak: > > In the journey success lies, in the destination not. > > -- Paul Ah, I always wondered what lemmings thought , before splat!!! :-) - Pad. -- http://mail.python.org/mailman/listinfo/python-list

Re: Code Golf Challenge : 1,000 Digits Of Pi

2006-09-18 Thread Paddy
rive/c/Documents and Settings/All Users/Documents/Python tutorial $ perl -v This is perl, v5.8.7 built for cygwin-thread-multi-64int (with 1 registered patch, see perl -V for more detail) Yep my standard Cygwin perl installation for windows includes the bignum package. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: +1 QOTW

2006-09-22 Thread Paddy
[EMAIL PROTECTED] wrote: > Did anyone else crack up when Larry Wall described python with the > statement: > > Python, as the "anti-Perl," is heavily invested in maintaining Order. > > In the state of the onion address? > > http://www.perl.com/pub/a/2006/09/21/onion.html -3 on QOTW ! The whole ar

Re: How to close the DOS Shell when starting a python script

2006-09-22 Thread Paddy
ns and a background DOS shell also opens. > Is there any way to prevent the DOS from opening? > What is weird is that when I create a freezed version (an executable), > then the DOS shell doens't open anymore. > Any clues? > Thanks for your help > M.E. Rename the .p

Re: Doctests for nested functions

2006-09-23 Thread Paddy
ample: bar() Expected: 11 Got: 10 1 items had no tests: __main__ ** 1 items had failures: 2 of 2 in __main__.foo 2 tests in 2 items. 0 passed and 2 failed. ***Test Failed*** 2 failures. *** DocTestR

R.S.I. solutions?

2006-09-25 Thread Paddy
I've finally tracked down a supplier with a large range of pointer devices: http://www.keytools.co.uk/mice/default.asp But I am unable to try them out before I buy. I was wondering if any Pythonistas had been through this and found something that worked for them? - Paddy. -- http://mail.

Re: Splitting device addresses into parts

2006-09-26 Thread Paddy
Fabian Steiner wrote: > Bruno Desthuilliers wrote: > > Fabian Steiner wrote: > >> I often have to deal with strings like "PCI:2:3.0" or "PCI:3.4:0" and > >> need the single numbers as tuple (2, 3, 0) or (3, 4, 0). Is there any > >> simple way to achieve this? So far I am using regular expressions

Re: OT: productivity and long computing delays

2006-09-27 Thread Paddy
M) but > the overall task isn't large enough to justify going out and buying > one. Anyway, I did the same build on a 2 ghz Athlon 64 and was > surprised that the speedup was only 35% or so. I'd have to get a > multiprocessor box to obtain really substantial gains. Read docu

Re: windev vs python SOS

2006-09-28 Thread Paddy
My french is attrocious so I got Michels original post machine transated. I liked what Michel was saying, maybe others would like to share: Hello! As you are French, you will coprendras me. Then: - windev is closed, and protected by dongles. Result: dongle lost, broken down, or flown, a licence s

Re: builtin regular expressions?

2006-10-01 Thread Paddy
Antoine De Groote wrote: > Hello, > > Can anybody tell me the reason(s) why regular expressions are not built > into Python like it is the case with Ruby and I believe Perl? Like for > example in the following Ruby code > > line = 'some string' > > case line >when /title=(.*)/ > puts "Tit

Re: basic python questions

2006-11-17 Thread Paddy
rting in python. Other documentation sources have a lot more. P.S. I have not run the code myself P.P.S. Where is the functions docstring! P.P.P.S. You might want to read up on enumerate. It gives another way to do things when you want an index as well as each item from an iterable but remember, t

Re: How can I speed this function up?

2006-11-17 Thread Paddy
t each program? How easy is it to explain each prog. to an audience that have programmed, but never in C or Python? How long would it take to add another feature? Best and best speed can have many meanings. good luck. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: basic python questions

2006-11-18 Thread Paddy
s no mean feat. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Abelson and Python

2006-11-22 Thread Paddy
d wanted to know why it was talked about so much? I'm from England, I know that MIT is a very prestigious university, but if Cambridge changed a course, or better still, The Open University changed a similar course to Python, I think I'd be hard pressed to hear about it. Is the MIT cours

Re: synching with os.walk()

2006-11-24 Thread Paddy
done and give them the option of aborting after generating the copy lists. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: synching with os.walk()

2006-11-24 Thread Paddy
Paddy wrote: > Andre Meyer wrote: > > > Hi all > > > > os.walk() is a nice generator for performing actions on all files in a > > directory and subdirectories. However, how can one use os.walk() for walking > > through two hierarchies at once? I want

Re: synching with os.walk()

2006-11-24 Thread Paddy
Paddy wrote: > P.S. If you are on a Unix type system you can use tar to do the copying > as you can easily compress the data if it needs to go over a sow link, Sow links, transfers your data and then may form a tasty sandwich when cooked. (The original should, of course, read ...slow...)

Re: Reading GDSII layouts

2006-11-28 Thread Paddy
EY, **it can read and edit existing GDSII files**. And at the bottom of the page: * Import of existing GDSII files into a layout (import.py) It looks to be a reader?! - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: 6 Pick Bet Grouping

2006-11-28 Thread Paddy
e totalizator system allows us to merge or group these four bets as > follows: > > 5 + 7 / 3 / 11 / 7 + 14 / 1 / 9 - $50 ($200 total) It is unclear to me how you go from the four lines to the one, (or vice-versa)? Could you expand the explanation? - paddy. -- http://mail.python.org/mailman/listinfo/python-list

XML blooming

2006-11-29 Thread Paddy
e lines of something that could translate between the world of the Traits package (http://code.enthought.com/traits/), and XSD/DTD/XML. Has anyone done this before? Thanks in advance, Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: What are python closures realy like?

2006-12-05 Thread Paddy
_val ... return (borg_var_inc, borg_var_dec) ... >>> up1, dn1 = fun_borg_var()# get an inc/decrementer >>> up1(0) 0 >>> up1() 1 >>> up1() 2 >>> dn1() 1 >>> dn1() 0 >>> dn1() -1 >>> up2, dn2 = fun_borg_var()# get another inc/decrementer >>> up2(0) # looks like the same _n -1 >>> up2(3) 2 >>> up1(3) 5 >>> - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: funcs without () like print

2006-12-07 Thread Paddy
unction or not: just look for the (). - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   7   >