Skip to content

Commit 5c41058

Browse files
committed
Update documentation
1 parent 84d12c8 commit 5c41058

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

_sources/chap13.ipynb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2128,8 +2128,12 @@
21282128
"source": [
21292129
"def replace_all(old, new, source_path, dest_path):\n",
21302130
" # read the contents of the source file\n",
2131+
" reader = open(source_path)\n",
2132+
"\n",
21312133
" # replace the old string with the new\n",
2132-
" # write the result into the destination file"
2134+
" \n",
2135+
" # write the result into the destination file\n",
2136+
" "
21332137
]
21342138
},
21352139
{

chap13.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,8 +1351,12 @@ <h3><span class="section-number">13.10.2. </span>Exercise<a class="headerlink" h
13511351
<div class="cell_input docutils container">
13521352
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">replace_all</span><span class="p">(</span><span class="n">old</span><span class="p">,</span> <span class="n">new</span><span class="p">,</span> <span class="n">source_path</span><span class="p">,</span> <span class="n">dest_path</span><span class="p">):</span>
13531353
<span class="c1"># read the contents of the source file</span>
1354+
<span class="n">reader</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">source_path</span><span class="p">)</span>
1355+
13541356
<span class="c1"># replace the old string with the new</span>
1357+
13551358
<span class="c1"># write the result into the destination file</span>
1359+
13561360
</pre></div>
13571361
</div>
13581362
</div>

0 commit comments

Comments
 (0)