[Tutor] Multiple search and replace?

2013-05-02 Thread Andy McKenzie
Hey folks, I'm trying to figure out how to do something, and it feels like it should be possible, but I can't figure out how. What I want is to define four expressions, like so: (\sNorth\s|\sN\s)(\sSouth\s|\sS\s)(\sEast\s|\sE\s)(\sWest\s|\sW\s) And then run a replace such that the groups are

Re: [Tutor] Multiple search and replace?

2013-05-02 Thread Peter Otten
Andy McKenzie wrote: > Hey folks, > > I'm trying to figure out how to do something, and it feels like it > should > be possible, but I can't figure out how. What I want is to define four > expressions, like so: > > (\sNorth\s|\sN\s)(\sSouth\s|\sS\s)(\sEast\s|\sE\s)(\sWest\s|\sW\s) > > And

[Tutor] query from sqlalchemy returns AttributeError: 'NoneType' object

2013-05-02 Thread Karthik Sharma
from pox.core import core import pox.openflow.libopenflow_01 as of import re import datetime from sqlalchemy import create_engine, ForeignKey from sqlalchemy import Column, Date, Integer, String from sqlalchemy.ext.declarative import declarative_base from sqlalchemy

Re: [Tutor] query from sqlalchemy returns AttributeError: 'NoneType' object :p:

2013-05-02 Thread Paradox
On 05/03/2013 06:13 AM, Karthik Sharma wrote: from sqlalchemy import create_engine, ForeignKey from sqlalchemy import Column, Date, Integer, String This list is mostly for standard library questions (though there may be some that can help here too). Did you know there is an sqlalchem

[Tutor] Why do I not get the same results for these two functions when I pass 7 as an argument?

2013-05-02 Thread Nonso Ibenegbu
Hello everyone, Wonder if someone can help me understand why these two codes do not give the same results for what looks essentially the same ("?") code. The argument passed is 7. def rental_car_cost(days): payment = days * 40 if days >= 7: return payment - 50 elif days >= 3 <