Negation in regular expressions

2006-09-07 Thread George Sakkis
#x27;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 -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Beautiful Soup to entangle bookmarks.html

2006-09-07 Thread George Sakkis
ls. Has anybody got a couple of longer examples using > Beautiful Soup I could play around with? > > Thanks, > Martin. from BeautifulSoup import BeautifulSoup urls = [tag['href'] for tag in BeautifulSoup(open('bookmarks.html')).findAll('a')] Regards, George -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Beautiful Soup to entangle bookmarks.html

2006-09-08 Thread George Sakkis
Francach wrote: > George Sakkis wrote: > > Francach wrote: > > > Hi, > > > > > > I'm trying to use the Beautiful Soup package to parse through the > > > "bookmarks.html" file which Firefox exports all your bookmarks into. > > >

Re: Negation in regular expressions

2006-09-08 Thread George Sakkis
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: Using Beautiful Soup to entangle bookmarks.html

2006-09-08 Thread George Sakkis
Francach wrote: > Hi George, > > Firefox lets you group the bookmarks along with other information into > directories and sub-directories. Firefox uses header tags for this > purpose. I'd like to get this grouping information out aswell. > > Regards, > Martin. Her

Re: SQLwaterheadretard3 (Was: Is it just me, or is Sqlite3 goofy?)

2006-09-08 Thread George Sakkis
ne reasons (complexity,portability,performance), so you'd better not go down this road. George -- http://mail.python.org/mailman/listinfo/python-list

Re: Function metadata (like Java annotations) in Python

2006-09-10 Thread George Sakkis
oripel wrote: > Thanks Paddy - you're showing normal use of function attributes. > They're still hidden when wrapped by an uncooperative decorator. The decorator module may be helpful in defining cooperative decorators: http://www.phyast.pitt.edu/~micheles/python/documentat

Re: Refactoring Dilemma

2006-09-10 Thread George Sakkis
> def MyRoutine(): > global var > var = 1 > > MyRoutine() > print var > > > # --- Module 2.py > # 'Self' module processing > import sys > var = 0 > self = sys.modules[__name__] > > def MyRoutine(): > self.var = 1 > > MyRoutine() > print var What's wrong with def MyRoutine(): return 1 var = MyRoutine() ? George -- http://mail.python.org/mailman/listinfo/python-list

Re: Refactoring Dilemma

2006-09-10 Thread George Sakkis
m__ > self = modproxy() > def call_with_module(*args,**kwargs): > return func(self,*args,**kwargs) > call_with_module.func_name = func.func_name > return call_with_module > > @modmethod > def MyRoutine(self): > self.var = 1 > > MyRoutine() > print var This looks quite hackish, both the implementation and the usage; most people would get confused when they didn't find var's assignment at global scope. I prefer the the simple global statements if they aren't that many, otherwise the assignment of the module to self is also fine. George -- http://mail.python.org/mailman/listinfo/python-list

Re: CPython keeps on getting faster

2006-09-10 Thread George Sakkis
u5)] Python2.5: 2.5c1 (r25c1:51305, Aug 18 2006, 19:18:03) [GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] IronPython: 1.0.2444 on .NET 2.0.50727.42 Mono JIT compiler version 1.1.17 TLS: normal GC:Included Boehm (with typed GC) SIGSEGV: normal Disabled: none George -- http://mail.python.org/mailman/listinfo/python-list

Re: efficient text file search.

2006-09-11 Thread George Sakkis
file ? The replies so far seem to imply so and in this case I doubt that you can do anything more efficient. OTOH, if the same file is to be searched repeatedly for different strings, an appropriate indexing scheme can speed things up considerably on average. George -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing String, Dictionary Lookups, Writing to Database Table

2006-09-11 Thread George Sakkis
cription it's not really clear what's going on. Also, please post working code; the snippets you posted were out of context (what is row?) and not always correct syntactically (split_line(2:4)). George -- http://mail.python.org/mailman/listinfo/python-list

Re: Dice gen and analyser script for RPGs: comments sought

2006-09-13 Thread George Sakkis
space between *every* operator in expressions, group them based on precedence. E.g. instead of "(n * sigmaSq - sigma * sigma) / (n * n)", I read it easier as "(n*sigmaSq - sigma*sigma) / (n*n). HTH, George -- http://mail.python.org/mailman/listinfo/python-list

Re: When is it a pointer (aka reference) - when is it a copy?

2006-09-13 Thread George Sakkis
n't tell in advance what "x[0] = 2" will do without knowing the type of x. A binding OTOH like "x=2" has always the same semantics: make the name "x" refer to the object "2". Similarly to "x[0] = 2", something like "x.foo = 2" looks like an assignment but it's again syntactic sugar for a (different) method call: x.__setattr__('foo',2). All the above about __setitem__ hold for __setattr__ too. HTH, George -- http://mail.python.org/mailman/listinfo/python-list

Re: stock quotes

2006-09-13 Thread George Sakkis
quest the certain data need. Does anyone > know how to do this? I would really appreciate it. Thanks. This will get you started: http://www.crummy.com/software/BeautifulSoup/ George -- http://mail.python.org/mailman/listinfo/python-list

Re: FtpUtils Progress Bar

2006-09-13 Thread George Sakkis
st dots going across the screen would be better > than nothing. > > Does anyone have an example on how to show the progress of the > upload/download when using ftputil? You'll probably have more luck asking at http://codespeak.net/mailman/listinfo/ftputil. George -- http://mail.python.org/mailman/listinfo/python-list

Re: Algorithm Question

2006-09-14 Thread George Sakkis
es each covering 1/4*R with zero overlap ? George -- http://mail.python.org/mailman/listinfo/python-list

Re: Algorithm Question

2006-09-14 Thread George Sakkis
sired property: the intersections of the subsets should be as small as possible, or in other words the subsets should be as distinct as possible. George -- http://mail.python.org/mailman/listinfo/python-list

Re: Check if variable is an instance of a File object

2006-09-15 Thread George Sakkis
t = StringIO(text) for line in text: # do something George -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I converted a null (0) terminated string to a Python string?

2006-09-15 Thread George Sakkis
Michael wrote: > Robert, > > Thanks to you and everyone else for the help. The "s.split('\x00', > 1)[0] " solved the problem. And a probably faster version: s[:s.index('\x00')] George -- http://mail.python.org/mailman/listinfo/python-list

Re: Coding Nested Loops

2006-09-15 Thread George Sakkis
in izip(*columns): > print row > > Now that is a nice occasion to get acquainted with the itertools module... Wow, that's the most comprehensive example of itertools (ab)use I have seen! Awesome! George -- http://mail.python.org/mailman/listinfo/python-list

Re: something for itertools

2006-09-15 Thread George Sakkis
) > > should turn into > > a = ( 1, 2, 3, None, None ) > b = ( 10, 20, None, None, None ) > c = ( 'x', 'y', 'z', 'e', 'f' ) > > Of course with some len( ) calls and loops this can be solved but > something tells me t

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

2006-09-18 Thread George Sakkis
Calvin Spealman wrote: > Just once, I would like to see a programming contest that was judged > on the quality of your code, not the number of bytes you managed to > incomprehensively hack it down to. Unfortunately, quality is not as easy to judge as number of bytes. Such contest would be as craz

Re: Curious issue with simple code

2006-09-19 Thread George Sakkis
les/python/path/). Your example could be rewritten simply as: from path import path for html_file in path(start_dir).walkfiles('*.html'): print 'html file found!' George -- http://mail.python.org/mailman/listinfo/python-list

Re: CONSTRUCT - Adding Functionality to the Overall System

2006-09-19 Thread George Sakkis
e: # default object msg If you insist though that you'd rather not use functions but only methods, tough luck; you're better off with Ruby. George -- http://mail.python.org/mailman/listinfo/python-list

Re: value exists (newbie question)

2006-09-19 Thread George Sakkis
the syntax to do that. (not asking anyone to write my > code, just looking for a pointer) > > Thanks Hint: dict.get() takes an optional second argument. George PS: To make a new thread, don't hit "reply" on an existing thread and change the subject. Just make a new thread.. duh. -- http://mail.python.org/mailman/listinfo/python-list

Re: new string method in 2.5 (partition)

2006-09-19 Thread George Sakkis
Bruno Desthuilliers wrote: > I must definitively be dumb, but so far I fail to see how it's better > than split and rsplit: I fail to see it too. What's the point of returning the separator since the caller passes it anyway* ? George * unless the separator can be a regex, but

Re: newbe's re question

2006-09-19 Thread George Sakkis
ample code before typing this python-like pseudocode ? George -- http://mail.python.org/mailman/listinfo/python-list

Strange behaviour of 'is'

2006-09-21 Thread Fijoy George
Hi all, I am a bit perplexed by the following behaviour of the 'is' comparator >>> x = 2. >>> x is 2. False >>> y = [2., 2.] >>> y[0] is y[1] True My understanding was that every literal is a constructure of an object. Thus, the '2.' in 'x = 2.' and the '2.' in 'x is 2.' are different objects.

Re: Using Beautiful Soup to entangle bookmarks.html

2006-09-21 Thread George Sakkis
robin wrote: > "George Sakkis" <[EMAIL PROTECTED]> wrote: > > >Here's what I came up with: > >http://rafb.net/paste/results/G91EAo70.html. Tested only on my > >bookmarks; see if it works for you. > > That URL is dead. Got another? Yeap, try this

Re: returning None instead of value: how to fix?

2006-09-23 Thread George Sakkis
7;s not just me that thinks this way. Best, George -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the best way to "get" a web page?

2006-09-23 Thread George Sakkis
relevant extract from the main page: You may either hardcode the urls of the css files, or parse the page, extract the css links and normalize them to absolute urls. The first is simpler but the second is more robust, in case a new css is added or an existing one is renamed or remov

Re: A critique of cgi.escape

2006-09-26 Thread George Sakkis
Lawrence D'Oliveiro wrote: > Fredrik Lundh wrote: > > you're not the designer... > > I don't have to be. Whoever the designer was, they had not properly thought > through the uses of this function. That's quite obvious already, to anybody > who works with HTML a lot. So the function is broken and

Re: does anybody earn a living programming in python?

2006-09-26 Thread George Sakkis
x27;t really qualify, for any reasonable definition of "senior". George -- http://mail.python.org/mailman/listinfo/python-list

Re: ultra newbie question (don't laugh)

2006-09-26 Thread George Sakkis
ties. Or, if you're comfortable studying on your own, you could start with a book or two that focus on software design and architecture, rather than language details and small programming recipes. I can't think of any specific title to suggest off the top of my head but I'm sure you'll get some good suggestions from others if you ask here. George -- http://mail.python.org/mailman/listinfo/python-list

Re: identifying new not inherited methods

2006-09-26 Thread George Sakkis
n, not attached to a specific class: from inspect import getmembers, ismethod def listMethods(obj): d = obj.__class__.__dict__ return [name for name,_ in getmembers(obj,ismethod) if name in d] HTH, George -- http://mail.python.org/mailman/listinfo/python-list

Re: identifying new not inherited methods

2006-09-26 Thread George Sakkis
[EMAIL PROTECTED] wrote: > George Sakkis wrote: > [...] > > I'd rather have it as a function, not attached to a specific class: > > > > Thanks a lot George, that was what I was looking for. Got to > understand/appreciate inspect more. > Of course it works as a

Re: iterator question

2006-09-26 Thread George Sakkis
erable) while True: window = tuple(islice(it,size)) if not window: break yield window George -- http://mail.python.org/mailman/listinfo/python-list

Re: iterator question

2006-09-26 Thread George Sakkis
t; return izip(*[chain(iterable, repeat(padvalue, n-1))]*n) That's not quite the same as the previous suggestions; if the last tuple is shorter than n, it pads the last tuple with padvalue. The OP didn't mention if he wants that or he'd rather have a shorter last tuple. George -- http://mail.python.org/mailman/listinfo/python-list

Re: iterator question

2006-09-26 Thread George Sakkis
Steve Holden wrote: > George Sakkis wrote: > > Neil Cerutti wrote: > > > > > >>On 2006-09-26, Neal Becker <[EMAIL PROTECTED]> wrote: > >> > >>>Any suggestions for transforming the sequence: > >>> > >>>[1, 2, 3, 4...

Re: Makin search on the other site and getting data and writing in xml

2006-09-26 Thread George Sakkis
risk to be caught (with whatever consequences this implies). - Yes, you *might* be able to get away with it (at least for some time) running in stealth mode. - No, people here are not willing to help you go down this road, you're on your own. Hope this helps, George -- http://mail.python.org/mailman/listinfo/python-list

Re: A critique of cgi.escape

2006-09-26 Thread George Sakkis
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, George > Sakkis wrote: > > > Lawrence D'Oliveiro wrote: > > > >> Fredrik Lundh wrote: > >> > you're not the designer... > >> > >> I don't have to be.

Re: Top and Bottom Values [PEP: 326]

2006-09-27 Thread George Sakkis
le purpose of being used in comparisons. No numeric behavior was implied, i.e. Smallest and Largest are not negative and positive infinity in the math sense of the word. So I guess the "easily implemented" refers to this case alone. George -- http://mail.python.org/mailman/listinfo/python-list

Re: pythonol

2006-09-27 Thread George Sakkis
gs, ints, longs, or tuples > -- > Does anything stand out which might be fixable? Search and replace all "EXPAND+FILL" with "EXPAND|FILL" (vertical bar instead of plus sign). This solves the specific error, though I've no idea what else may be broken. George -- http://mail.python.org/mailman/listinfo/python-list

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

2006-09-27 Thread George Sakkis
ow how to program; teaching them DSA, python, **and** stuff like the > visitor pattern seems impossible. "Beginning Python - From Novice to Professional" is approachable and great as a textbook IMO. As a bonus, it covers up to python 2.4, which very few existing books do. George -- http://mail.python.org/mailman/listinfo/python-list

Re: Can string formatting be used to convert an integer to its binary form ?

2006-09-28 Thread George Sakkis
y discovered the joy of obfuscated python thanks to the Code Golf challenges, here's the shortest non-recursive function I came up with (all integers, signed): f=lambda n:'-'[:n<0]+''.join(str(m&1)for m in iter( lambda x=[abs(n)]:(x[0],x.__setitem__(0,x[0]>>1))[0],0))[::-1]or'0' Any takers ? ;-) George -- http://mail.python.org/mailman/listinfo/python-list

Re: Can string formatting be used to convert an integer to its binary form ?

2006-09-28 Thread George Sakkis
s = array('c') while n>0: s.append('01'[n&1]) n >>= 1 s.reverse() return s.tostring() or '0' try: import psyco except ImportError: pass else: psyco.bind(fast2bin) George -- http://mail.python.org/mailman/listinfo/python-list

Re: How to iterate through a sequence, grabbing subsequences?

2006-09-29 Thread George Sakkis
yield s[i:i+chunksize] > > I wrote this because I need to take a string of a really, really long > length and process 4000 bytes at a time. > > Is there a better solution? There's not any builtin for this, but the same topic came up just three days ago: http://tinyurl.com/qec2

Re: How to query a function and get a list of expected parameters?

2006-09-29 Thread George Sakkis
l): >>> from inspect import getargspec >>> getargspec(f) (['x1', 'x2'], None, None, None) George -- http://mail.python.org/mailman/listinfo/python-list

Re: Automatic methods in new-style classes

2006-09-29 Thread George Sakkis
ultiple backends""" def __init__(self, backends): self.backends = backends @forall_backends def flush(self): 'Flush all backends' @forall_backends def draw(self, x, y): 'Draw point (x,y) on all backends' m = MultiBackend([Foo(),Bar()]) m.flush() m.draw(1,2) #== HTH, George -- http://mail.python.org/mailman/listinfo/python-list

loop beats generator expr creating large dict!?

2006-10-02 Thread George Young
ll it's entries at once to create itself faster? -- George Young -- "Are the gods not just?" "Oh no, child. What would become of us if they were?" (C.S. Lewis) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python to use a non open source bug tracker? - Trac?

2006-10-04 Thread Harry George
it is "Roundup or else non-python COTS"? I gave up on Roundup a while ago due to too many crashes. I'm now using Trac: a) Open Source b) Python c) Adequate functionality (for me at least) http://trac.edgewall.org/ I'm not trying to "sell" Trac, but

Re: Overwrite only one function with property()

2006-11-18 Thread George Sakkis
or is this not possible? There are no default functions for getx, setx, delx; you have to specify what you expect to happen when you write a.p, a.p = v and del a.p, respectively. What would, for example, be the default getx that you don't want to overwrite ? George -- http://mail.python.org/mailman/listinfo/python-list

Re: Trying to understand Python objects

2006-11-21 Thread George Sakkis
j) and new style classes. > > (snipped) > >I think this flexibility is part the python philosophy, but I am not a python > philosopher (nor was I meant to be). Neither a python tutor, apparently, but strong candidate for the monthly "most confusing-to-a-newbie reply" award. George -- http://mail.python.org/mailman/listinfo/python-list

Re: Trying to understand Python objects

2006-11-23 Thread George Sakkis
self.__getitem__ = lambda i: i*x I'm not sure if this is a conscious choice or a technical limitation of how new-style classes work internally, but I've had a use for it at least once. George -- http://mail.python.org/mailman/listinfo/python-list

Re: Python script and C++

2006-11-27 Thread George Sakkis
Python function and boosting it using several different tools. Check out the final comparison table first; the pyrex version is less than half a second slower than the C++. George -- http://mail.python.org/mailman/listinfo/python-list

Re: Remarkable results with psyco and sieve of Eratosthenes

2006-11-29 Thread George Sakkis
if y > maxfact: > primes.append(x) > break > if not x%y: > break > return primes You can also save an attribute lookup for append; just add append = primes.append outside of the loop and replace primes.append(x) with append(x) That should cut down a few fractions of second. George -- http://mail.python.org/mailman/listinfo/python-list

Re: Pimping the 'cgi' module (was: Re: python gaining popularity according to a study)

2006-11-30 Thread Harry George
m/~hgg9140/comp/pyperlish/doc/manual.html http://www.seanet.com/~hgg9140/comp/cgipm/doc/index.html Others on this newsgroup said I'd be better off just doing it in raw python. After a while, I realized that was true. You do triple-quoted templates with normal python idioms. Throw in some persistence mechanisms to deal with maintaining state across transactions, and you are in business. Since then I've looked at Zope, Plone, TurboGears, Django, and (for standalone apps) Dabo. TurboGears is mostly a set of recommendations on what 3rd party packages to use, with a wee bit of glueware. So far nothing feels as simple as just doing it in python. -- Harry George PLM Engineering Architecture -- http://mail.python.org/mailman/listinfo/python-list

Re: More elegant to get a name: o.__class__.__name__

2006-12-01 Thread George Sakkis
... >>> X.__class__ AttributeError: class X has no attribute '__class__' So to handle all cases, you'd have to go with: def typename(o): try: cls = o.__class__ except AttributeError: cls = type(o) return cls.__name__ # or for fully qualified names # return '%s.%s' % (cls.__module__, cls.__name__) George -- http://mail.python.org/mailman/listinfo/python-list

Re: global name 'self' is not defined

2006-12-02 Thread George Sakkis
7;self' is not defined'? What I want is to have the > dictionary 'estoc' available in my calling script. > > Thanks, Evan Please post examples that reproduce the error; what you posted doesn't even refer to "self" at all. George -- http://mail.python.org/mailman/listinfo/python-list

Re: About alternatives to Matlab

2006-12-03 Thread George Sakkis
n-of-lesser-python.html before you commit to writing what will turn out to be yet another "80% Python" VM / JIT compiler. George -- http://mail.python.org/mailman/listinfo/python-list

Re: Pimping the 'cgi' module

2006-12-04 Thread Harry George
robert <[EMAIL PROTECTED]> writes: > Harry George wrote: > > When I came from Perl, I too missed perl-isms and specifically CGI.pm, so > > wrote my own: > > http://www.seanet.com/~hgg9140/comp/index.html > > http://www.seanet.com/~hgg9140/comp/pyperlish/doc/manu

Re: Factory pattern implementation in Python

2006-12-04 Thread George Sakkis
dispatcher could then be as simple as: import events def parseEvents(file): while not file.eof(): ev = int(file.read(1)) cls = getattr(events, 'Evt%d' % ev) cls(file).execute() By the way, it is not clear from your description if the event number equals to the size of the associated data. If it is, you can factor out the data extraction part in the factory function and pass just the extracted data in the Event constructor instead of the file: def parseEvents(file): while not file.eof(): ev = int(file.read(1)) cls = getattr(events, 'Evt%d' % ev) cls(file.read(ev)).execute() George -- http://mail.python.org/mailman/listinfo/python-list

Re: Ensure a variable is divisible by 4

2006-12-04 Thread George Sakkis
[EMAIL PROTECTED] wrote: > I am sure this is a basic math issue, but is there a better way to > ensure an int variable is divisible by 4 than by doing the following; > > x = 111 > x = (x /4) * 4 > > Just seems a bit clunky to me. if x % 4 == 0: # x is divisible by

Re: Factory pattern implementation in Python

2006-12-04 Thread George Sakkis
Romulo A. Ceccon wrote: > George Sakkis wrote: > > > If you actually intend to > > 1) name your Event subclasses Evt1, Evt2, ... EvtN and not give more > > descriptive (but unrelated to the magic event number) names > > No, those names are just an example. The act

Re: per instance descriptors

2006-12-06 Thread George Sakkis
mands. > > Is there any way of doing this nicely in Python? What about __setattr__ ? At least from your example, checking happens only when you set an attribute. If not, post a more representative sample of what you're trying to do. George -- http://mail.python.org/mailman/listinfo/python-list

Re: per instance descriptors

2006-12-07 Thread George Sakkis
[EMAIL PROTECTED] wrote: > George Sakkis wrote: > > Simon Bunker wrote: > > > > > Hi I have code similar to this: > > > > > > class Input(object): > > > > > > def __init__(self, val): > > > self.value = val &g

Re: A Call to Arms for Python Advocacy

2006-12-07 Thread George Sakkis
y of these? [coming_from[lang].advocacy_kit for lang in ('C/C++', 'Java', 'Perl', 'PHP', 'Visual Basic')] (the six more popular than Python according to http://www.tiobe.com/tpci.htm) George -- http://mail.python.org/mailman/listinfo/python-list

Re: Common Python Idioms

2006-12-07 Thread George Sakkis
org/labs/python_pitfalls.html > http://www.ferg.org/projects/python_gotchas.html > http://www.onlamp.com/pub/a/python/2004/02/05/learn_python.html > > Danny I'm surprized that none of these pages mentions the incompatible type comparison gotcha: >>> 5 < "4" Tru

Re: Common Python Idioms

2006-12-08 Thread George Sakkis
Steven D'Aprano wrote: > On Thu, 07 Dec 2006 13:52:33 -0800, George Sakkis wrote: > > > I'm surprized that none of these pages mentions the incompatible type > > comparison gotcha: > > > >>>> 5 < "4" > > True > > > >

Re: autoadd class properties

2006-12-08 Thread George Sakkis
e reinventing a part of an ORM. Have you checked out SQLAlchemy or Django's ORM, in case they provide what you want out of the box ? George -- http://mail.python.org/mailman/listinfo/python-list

Re: I think Python is a OO and lite version of matlab

2006-12-08 Thread George Sakkis
Allen wrote: > Does anyone agree with me? > If you have used Matlab, welcome to discuss it. Sure, and earth is a heavy version of a basketball. If all you have is a hammer... George -- http://mail.python.org/mailman/listinfo/python-list

Re: I think Python is a OO and lite version of matlab

2006-12-08 Thread Harry George
ape-changing fluidity, and is subject to radially symmetric shape-impacting processes. Magma and gravity for the earth, leather and air pressure for inflated balls, sand and accretion for beach "cannonballs", and snow and hand pressure for snowballs. -- Harry George PLM Engineering Architecture -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-08 Thread Harry George
st a newbie thing. Even people who are reasonably fluent in Lisp use Python for many tasks, and some make python the default with Lisp as a special case. It would probably be fair to say that the more you know about a variety of languages, the more you appreciate Python. -- Harry George PLM Engineering Architecture -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-08 Thread George Sakkis
sp is an obfuscated version of Python > > hell no, lisp's syntax is much easier than python's since it's homogenous It sure is easier... if you're a compiler rather than a human. Also a lightbulb is much easier understood as a bunch of homogeneous elemental particles. George -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-08 Thread George Sakkis
use nobody can read each other's code any more." http://mail.python.org/pipermail/python-3000/2006-April/000286.html. George -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-08 Thread George Sakkis
[EMAIL PROTECTED] wrote: > Okay, since everyone ignored the FAQ, I guess I can too... > > Mark Tarver wrote: > > How do you compare Python to Lisp? What specific advantages do you > > think that one has over the other? > > (Common) Lisp is the only industrial strength language with both pure > com

Re: merits of Lisp vs Python

2006-12-08 Thread George Sakkis
Ken Tilton wrote: > George Sakkis wrote: > > [EMAIL PROTECTED] wrote: > > > >>Okay, since everyone ignored the FAQ, I guess I can too... > >> > >>Mark Tarver wrote: > >> > >>>How do you compare Python to Lisp? What sp

Re: autoadd class properties

2006-12-08 Thread George Sakkis
perties. Can you advise > me on how to do this? I'm afraid not, at least not without seeing an example. By the way, I've never heard of Cache before and its name is too generic for looking it up online; you should at least provide a link if you're asking for help about obscure packages. George -- http://mail.python.org/mailman/listinfo/python-list

Re: Pyparsing troubles

2006-12-11 Thread Harry George
with a regexp engine b) Context Free Grammar (CFG), parseable with a LL(1) or LALR(1) parser. c) Context Dependent Grammar, parseable with an ad hoc parser with special rules. d) Free text, not parseable in the normal sense, but perhaps understandable with statistical analysis NLP te

Re: merits of Lisp vs Python

2006-12-11 Thread Harry George
) can look quite impressive. I've see data suggesting Ruby is replacing Perl and maybe Java. But I've yet to see data which shows people dropping Python and moving to Ruby. Where do I find that data? -- Harry George PLM Engineering Architecture -- http://mail.python.org/mailman/listinfo/python-list

Re: free, python XML merger?

2006-12-11 Thread Harry George
overriding > data for the same tags. > > Thanks in advance, > sulu > Sounds like a general XML problem, to be solved with cElementTree perhaps. Can you provide the schema and small examples of the input files and the desired output file? -- Harry George PLM Engineering Architecture

Re: merits of Lisp vs Python

2006-12-11 Thread George Sakkis
classes, etc.). Generic functions are available even today from the PEAK framework; see for example http://www-128.ibm.com/developerworks/library/l-cppeak2/. George -- http://mail.python.org/mailman/listinfo/python-list

Re: object data member dumper?

2006-12-12 Thread George Sakkis
tom arnall wrote: > >object data member dumper? > >George Sakkis george.sakkis at gmail.com > >Wed Nov 8 03:42:47 CET 2006 > > > tom arnall wrote: > > > > > Bruno Desthuilliers wrote: > > > > > > > tom arnall a écrit : > > >

Re: merits of Lisp vs Python

2006-12-12 Thread George Sakkis
e than one files using the fileinput module (http://docs.python.org/lib/module-fileinput.html): import fileinput # iterate over the lines of the files passed as command line # arguments (sys.argv[1:]) or sys.stdin for no arguments for line in fileinput.input(): foo(line) I'

Frame hacking

2006-12-12 Thread George Sakkis
s in the trace function, but it doesn't seem to work. Any other ideas ? George -- http://mail.python.org/mailman/listinfo/python-list

Re: Frame hacking

2006-12-12 Thread George Sakkis
Gabriel Genellina wrote: > On 12 dic, 17:46, "George Sakkis" <[EMAIL PROTECTED]> wrote: > > > I wonder if the following is possible: > > > > def inject_n_call(func, **kwds): > > '''Call func by first updating its locals with

Re: merits of Lisp vs Python

2006-12-12 Thread George Sakkis
ove code > around. Why is selecting a valid s-expression easier than selecting a python block ? If you mistakenly select an extra parenthesis or omit one, it's the same thing. Having said that, I find this problem is mostly academic in both languages with modern editors... there are less tr

Re: Frame hacking

2006-12-13 Thread George Sakkis
George Sakkis wrote: > Gabriel Genellina wrote: > > On 12 dic, 17:46, "George Sakkis" <[EMAIL PROTECTED]> wrote: > > > > > I wonder if the following is possible: > > > > > > def inject_n_call(func, **kwds): > > > '

ANN: Pyflix-0.1

2006-12-14 Thread George Sakkis
to focus on the real problem, the recommendation system algorithm. You may download Pyflix and find more about it at http://pyflix.python-hosting.com. Enjoy and good luck! George -- http://mail.python.org/mailman/listinfo/python-list

Re: Property error

2006-12-15 Thread George Sakkis
setattr(self,'_age',value)) If any of fget,fset,fdel cannot be written as lambda or you'd rather write them as functions, you may use the recipe at http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/410698. HTH, George -- http://mail.python.org/mailman/listinfo/python-list

Re: tuple.index()

2006-12-15 Thread George Sakkis
as distinct semantics, but from my experience these are far less common than the unlimited-extra-arguments case. George -- http://mail.python.org/mailman/listinfo/python-list

Re: Property error

2006-12-15 Thread George Sakkis
setattr(self,'_age',value)) If any of fget,fset,fdel cannot be written as lambda or you'd rather write them as functions, you may use the recipe at http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/410698. HTH, George -- http://mail.python.org/mailman/listinfo/python-list

Re: Property error

2006-12-15 Thread George Sakkis
setattr(self,'_age',value)) If any of fget,fset,fdel cannot be written as lambda or you'd rather write them as functions, you may use the recipe at http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/410698. HTH, George -- http://mail.python.org/mailman/listinfo/python-list

Re: Property error

2006-12-15 Thread George Sakkis
setattr(self,'_age',value)) If any of fget,fset,fdel cannot be written as lambda or you'd rather write them as functions, you may use the recipe at http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/410698. HTH, George -- http://mail.python.org/mailman/listinfo/python-list

urllib.unquote and unicode

2006-12-18 Thread George Sakkis
position 0: ordinal not in range(128) # Python 2.5 u'\x94' Is the current version the "right" one or is this function supposed to change every other week ? George -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib.unquote and unicode

2006-12-19 Thread George Sakkis
Fredrik Lundh wrote: > George Sakkis wrote: > > > The following snippet results in different outcome for (at least) the > > last three major releases: > > > >>>> import urllib > >>>> urllib.unquote(u'%94') > > > > # P

Re: on PySol's popularity

2006-12-19 Thread Harry George
I had to reinstall Python2.2 in order to use the old PySol binaries (couldn't get the build-from-source to work). Linux and Python got a fan due to PySol. It should be considered a cultural treasure, and if a bit of funding would help keep it rolling into the future, that might be worthwhile.

Re: def index(self):

2006-12-20 Thread George Sakkis
e several free tutorials online and come back when you have trouble with something specific you didn't understand. George -- http://mail.python.org/mailman/listinfo/python-list

Re: Decorator for Enforcing Argument Types

2006-12-21 Thread George Sakkis
John Machin wrote: > Bruno Desthuilliers wrote: > > > > > Python is dynamic, and fighting against the language is IMHO a really > > bad idea. The only places where theres a real need for this kind of > > stuff are when dealing with the "outside world" (IOW : inputs and > > outputs). And then packa

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