Re: Optional algol syntax style

2005-09-05 Thread Christoph Rackwitz
You didn't quite get the OP's intention, I guess. The OP wanted Python to be a bit more freeform by adding "end" tags. That might be an improvement for web scripting, but I haven't seen the solutions of the existing frameworks and won't dare to compare. -- http://mail.python.org/mailman/listinfo

Re: Please Criticize My Code

2005-08-21 Thread Christoph Rackwitz
Why not? Because the regex isn't compiled? Don't tell me not to do something, tell me why i should'nt do it. -- http://mail.python.org/mailman/listinfo/python-list

Re: Please Criticize My Code

2005-08-20 Thread Christoph Rackwitz
i guess, it is pythonchallenge.com level 10? if so, i used this thing: import re def enc(s): return ''.join('%s%s' % (len(a[0]),a[0][0]) for a in re.findall('((.)\\2*)', s)) -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I exclude a word by using re?

2005-08-14 Thread Christoph Rackwitz
re.findall('(.*)hello|(.*)', 'hi, how are you. hello') re.findall('(.*)hello|(.*)', 'hi, how are you. ello') take a look at the outputs of these. -- http://mail.python.org/mailman/listinfo/python-list

Re: Replacing last comma in 'C1, C2, C3' with 'and' so that it reads 'C1, C2 and C3'

2005-07-12 Thread Christoph Rackwitz
foo = "C1, C2, C3" foo = foo.split(", ") # ['C1', 'C2', 'C3'] foo = ", ".join(foo[:-1]) + " and " + foo[-1] # just slicing and joining it you can always look for something here: http://docs.python.org/lib/lib.html and there: http://docs.python.org/ref/ if you want to know, what methods an object

Re: splitting delimited strings

2005-06-15 Thread Christoph Rackwitz
You could use regular expressions... it's an FSM of some kind but it's faster *g* check this snippet out: def mysplit(s): pattern = '((?:"[^"]*")|(?:[^ ]+))' tmp = re.split(pattern, s) res = [ifelse(i[0] in ('"',"'"), lambda:i[1:-1], lambda:i) for i in tmp if i.strip()]

Re: New WYSIWYG Python IDE in the works

2005-06-15 Thread Christoph Rackwitz
(Sorry for that other post of mine. I don't know what went wrong) Don't get me wrong - your project is pretty interesting and you can certainly get valuable experience from it - but to be better than the competition you need to be better than the competition. -- http://mail.python.org/mailman/li

Re: New WYSIWYG Python IDE in the works

2005-06-15 Thread Christoph Rackwitz
root wrote: > Hello all > > I am currently developing a new WYSIWYG RAD tool for python. > There are screenshots and a small video demo on the site. > Please visit at http://www.geocities.com/visualfltk > > Cheers > JMan -- http://mail.python.org/mailman/listinfo/python-list