Using python screws up the shell (and/or terminal?)!
There appears to be an issue with recent Macports builds of python see this bug
A workaround is to install pyXX-readline (py35-readline has been produced just for this bug)
Another is to install python addding the +readline variant