Skip to content

Commit

Permalink
Merge pull request #66 from bargool/master
Browse files Browse the repository at this point in the history
Move some print statements to functions
  • Loading branch information
crazyguitar authored Oct 12, 2018
2 parents c15c483 + f233adc commit 4b2f10d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions docs/notes/python-rexp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ Compare HTML tags
>>> s = urllib.urlopen('https://www.python.org')
>>> html = s.read()
>>> s.close()
>>> print "open tags"
>>> print("open tags")
open tags
>>> re.findall('<[^/>][^>]*>', html)[0:2]
['<!doctype html>', '<!--[if lt IE 7]>']
>>> print "close tags"
>>> print("close tags")
close tags
>>> re.findall('</[^>]+>', html)[0:2]
['</script>', '</title>']
>>> print "self-closing tags"
>>> print("self-closing tags")
Group Comparison
----------------
Expand Down
4 changes: 2 additions & 2 deletions docs/notes/python-unicode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ python2 take ``str`` char as byte character
.. code-block:: python
>>> s= 'Café'
>>> print [_c for _c in s]
>>> print([_c for _c in s])
['C', 'a', 'f', '\xc3', '\xa9']
>>> len(s)
5
>>> s = u'Café'
>>> print [_c for _c in s]
>>> print([_c for _c in s])
[u'C', u'a', u'f', u'\xe9']
>>> len(s)
4
Expand Down

0 comments on commit 4b2f10d

Please sign in to comment.