Skip to content

Instantly share code, notes, and snippets.

@evdb
Created May 10, 2013 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evdb/5555370 to your computer and use it in GitHub Desktop.
Save evdb/5555370 to your computer and use it in GitHub Desktop.
(virtualenv-citizenconnect)evdb@custard-2 ~/mysociety/citizenconnect/citizenconnect $ python
Python 2.7.3 (default, Aug 8 2012, 14:50:51)
[GCC 4.2.1 Compatible Apple Clang 4.0 ((tags/Apple/clang-421.0.60))] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import urlparse
>>> o = urlparse.urlparse('http://foo.com/foo/bar?baz=bundy')
>>> o
ParseResult(scheme='http', netloc='foo.com', path='/foo/bar', params='', query='baz=bundy', fragment='')
>>> o.path = o.path + '.html'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: can't set attribute
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment