Skip to content

Commit 878bf06

Browse files
DOC - Moving Tips and Trick from wiki to Style Guide - added Reading fromr URl and Reading from file named file.txt that's inside of a zip file named file.zip
1 parent cb35d8a commit 878bf06

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

doc/source/development/code_style.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,25 @@ For example:
159159

160160
# wrong
161161
from common import test_base
162+
163+
Testing
164+
=======
165+
166+
Reading from a url
167+
------------------
168+
169+
.. code-block:: python
170+
171+
from pandas.io.common import urlopen
172+
with urlopen('http://www.google.com') as url:
173+
raw_text = url.read()
174+
175+
176+
Reading a file named file.txt that's inside of a zip file named file.zip
177+
------------------------------------------------------------------------
178+
179+
.. code-block:: python
180+
181+
from pandas.io.common import ZipFile
182+
with ZipFile('file.zip') as zf:
183+
raw_text = zf.read('file.txt')

0 commit comments

Comments
 (0)