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

Re: Your beloved python features

2010-02-06 Thread Schif Schaf
On Feb 5, 8:49 am, Roald de Vries r...@roalddevries.nl 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

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 al...@start.no 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

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

2010-02-07 Thread Schif Schaf
On Feb 7, 8:57 am, Tim Chase python.l...@tim.thechases.com 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

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.

Re: recommendation for webapp testing?

2009-09-16 Thread Schif Schaf
On Sep 16, 8:55 am, Simon Brunning si...@brunningonline.net wrote: 2009/9/16 Schif Schaf schifsc...@gmail.com: 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

Re: recommendation for webapp testing?

2009-09-16 Thread Schif Schaf
On Sep 16, 12:19 pm, Michele Simionato michele.simion...@gmail.com 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

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

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(