Re: Help with regex search-and-replace (Perl to Python)

2010-02-07 Thread Schif Schaf
On Feb 7, 8:57 am, Tim Chase wrote: > Steve Holden wrote: > > > Really? Under what circumstances does a simple one-for-one character > > replacement operation fail? > > Failure is only defined in the clarified context of what the OP > wants :)  Replacement operations only fail if the OP's desired

Re: Help with regex search-and-replace (Perl to Python)

2010-02-06 Thread Schif Schaf
On Feb 7, 12:19 am, "Alf P. Steinbach" wrote: > > I haven't used regexps in Python before, but what I did was (1) look in the > documentation, Hm. I checked in the repl, running `import re; help(re)` and the docs on the `sub()` method didn't say anything about using back-refs in the replacement

Re: Your beloved python features

2010-02-06 Thread Schif Schaf
On Feb 5, 8:49 am, Roald de Vries wrote: > My reasoning: I needed a language more powerful than bash, but more   > portable and faster to develop (at least small scripts) than C/C++. So   > I needed a scripting language. Python, Ruby, Perl, Tcl, ...? > > Python seems to be the language with the m

Help with regex search-and-replace (Perl to Python)

2010-02-06 Thread Schif Schaf
Hi, I've got some text that looks like this: Lorem [ipsum] dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut [labore] et [dolore] magna aliqua. and I want to make it look like this: Lorem {ipsum} dolor sit amet, consectetur adipisicing elit,

Am I doing this wrong? Why does this seem so clumsy (time, datetime vs. DateTime)

2009-09-19 Thread Schif Schaf
The other day I needed to convert a date like "August 2009" into a "seconds-since-epoch" value (this would be for the first day of that month, at the first second of that day). In Python, I came up with this: #!/usr/bin/env python import datetime import time time_in_sse = time.mktime(

Re: recommendation for webapp testing?

2009-09-16 Thread Schif Schaf
After some more searching I found Mechanize (a Python version of Perl's WWW::Mechanize): http://wwwsearch.sourceforge.net/mechanize/ Anyone here tried it? -- http://mail.python.org/mailman/listinfo/python-list

Re: recommendation for webapp testing?

2009-09-16 Thread Schif Schaf
On Sep 16, 12:19 pm, Michele Simionato wrote: > > twill is still good. Well, this http://twill.idyll.org/ seems to be the twill website, but it looks pretty out of date. I also found this http://code.google.com/p/twill/ , which is somewhat newer. No activity in the last 3 and a half months thoug

Re: recommendation for webapp testing?

2009-09-16 Thread Schif Schaf
On Sep 16, 8:55 am, Simon Brunning wrote: > 2009/9/16 Schif Schaf : > > > > I need to do some basic website testing (log into account, add item to > > cart, fill out and submit forms, check out, etc.). What modules would > > be good to use for webapp testing like this?

recommendation for webapp testing?

2009-09-15 Thread Schif Schaf
Hi, I need to do some basic website testing (log into account, add item to cart, fill out and submit forms, check out, etc.). What modules would be good to use for webapp testing like this? >From a bit of searching, it looks like twill was used for this, but it hasn't been updated in some time. -