|
40 | 40 | <link rel="top" title="Fundamentals of Python alpha documentation" href="../index.html"/>
|
41 | 41 | <link rel="up" title="Module 1: Getting Started with Python" href="../module_1.html"/>
|
42 | 42 | <link rel="next" title="Installing Python" href="Installing_Python.html"/>
|
43 |
| - <link rel="prev" title="Module 1: Getting Started with Python" href="../module_1.html"/> |
| 43 | + <link rel="prev" title="A Quick Guide to Formatting" href="SiteFormatting.html"/> |
44 | 44 |
|
45 | 45 |
|
46 | 46 | <script src="../_static/js/modernizr.min.js"></script>
|
|
97 | 97 | <ul class="current">
|
98 | 98 | <li class="toctree-l1"><a class="reference internal" href="../intro.html">Essentials of Python, for Data Science Applications</a></li>
|
99 | 99 | <li class="toctree-l1 current"><a class="reference internal" href="../module_1.html">Module 1: Getting Started with Python</a><ul class="current">
|
| 100 | +<li class="toctree-l2"><a class="reference internal" href="SiteFormatting.html">A Quick Guide to Formatting</a></li> |
100 | 101 | <li class="toctree-l2 current"><a class="current reference internal" href="#">Introducing the Python Programming Language</a><ul>
|
101 | 102 | <li class="toctree-l3"><a class="reference internal" href="#What-is-Python?">What is Python?</a></li>
|
102 | 103 | <li class="toctree-l3"><a class="reference internal" href="#Python-Scripts">Python Scripts</a></li>
|
103 | 104 | <li class="toctree-l3"><a class="reference internal" href="#What-is-a-Python-Interpreter-and-What-Does-it-Mean-to-“Install-Python”?">What is a Python Interpreter and What Does it Mean to “Install Python”?</a></li>
|
104 | 105 | <li class="toctree-l3"><a class="reference internal" href="#Why-Python?">Why Python?</a></li>
|
105 |
| -<li class="toctree-l3"><a class="reference internal" href="#A-Quick-Guide-to-Formatting">A Quick Guide to Formatting</a></li> |
106 | 106 | <li class="toctree-l3"><a class="reference internal" href="#Summary">Summary</a></li>
|
107 | 107 | </ul>
|
108 | 108 | </li>
|
|
181 | 181 |
|
182 | 182 |
|
183 | 183 | <style>
|
184 |
| -/* CSS for nbsphinx extension */ |
185 |
| - |
186 |
| -/* remove conflicting styling from Sphinx themes */ |
187 |
| -div.nbinput, |
188 |
| -div.nbinput div.prompt, |
189 |
| -div.nbinput div.input_area, |
190 |
| -div.nbinput div[class*=highlight], |
191 |
| -div.nbinput div[class*=highlight] pre, |
192 |
| -div.nboutput, |
193 |
| -div.nbinput div.prompt, |
194 |
| -div.nbinput div.output_area, |
195 |
| -div.nboutput div[class*=highlight], |
196 |
| -div.nboutput div[class*=highlight] pre { |
197 |
| - background: none; |
198 |
| - border: none; |
199 |
| - padding: 0 0; |
200 |
| - margin: 0; |
201 |
| - box-shadow: none; |
202 |
| -} |
203 |
| - |
204 |
| -/* avoid gaps between output lines */ |
205 |
| -div.nboutput div[class*=highlight] pre { |
206 |
| - line-height: normal; |
207 |
| -} |
208 |
| - |
209 |
| -/* input/output containers */ |
210 |
| -div.nbinput, |
211 |
| -div.nboutput { |
212 |
| - display: -webkit-flex; |
213 |
| - display: flex; |
214 |
| - align-items: flex-start; |
215 |
| - margin: 0; |
216 |
| - width: 100%; |
217 |
| -} |
218 |
| -@media (max-width: 540px) { |
219 |
| - div.nbinput, |
220 |
| - div.nboutput { |
221 |
| - flex-direction: column; |
222 |
| - } |
223 |
| -} |
224 |
| - |
225 |
| -/* input container */ |
226 |
| -div.nbinput { |
227 |
| - padding-top: 5px; |
228 |
| -} |
229 |
| - |
230 |
| -/* last container */ |
231 |
| -div.nblast { |
232 |
| - padding-bottom: 5px; |
233 |
| -} |
234 |
| - |
235 |
| -/* input prompt */ |
236 |
| -div.nbinput div.prompt pre { |
237 |
| - color: #303F9F; |
238 |
| -} |
239 |
| - |
240 |
| -/* output prompt */ |
241 |
| -div.nboutput div.prompt pre { |
242 |
| - color: #D84315; |
243 |
| -} |
244 |
| - |
245 |
| -/* all prompts */ |
246 |
| -div.nbinput div.prompt, |
247 |
| -div.nboutput div.prompt { |
248 |
| - min-width: 8ex; |
249 |
| - padding-top: 0.4em; |
250 |
| - padding-right: 0.4em; |
251 |
| - text-align: right; |
252 |
| - flex: 0; |
253 |
| -} |
254 |
| -@media (max-width: 540px) { |
255 |
| - div.nbinput div.prompt, |
256 |
| - div.nboutput div.prompt { |
257 |
| - text-align: left; |
258 |
| - padding: 0.4em; |
259 |
| - } |
260 |
| - div.nboutput div.prompt.empty { |
261 |
| - padding: 0; |
262 |
| - } |
263 |
| -} |
264 |
| - |
265 |
| -/* disable scrollbars on prompts */ |
266 |
| -div.nbinput div.prompt pre, |
267 |
| -div.nboutput div.prompt pre { |
268 |
| - overflow: hidden; |
269 |
| -} |
270 |
| - |
271 |
| -/* input/output area */ |
272 |
| -div.nbinput div.input_area, |
273 |
| -div.nboutput div.output_area { |
274 |
| - padding: 0.4em; |
275 |
| - -webkit-flex: 1; |
276 |
| - flex: 1; |
277 |
| - overflow: auto; |
278 |
| -} |
279 |
| -@media (max-width: 540px) { |
280 |
| - div.nbinput div.input_area, |
281 |
| - div.nboutput div.output_area { |
282 |
| - width: 100%; |
283 |
| - } |
284 |
| -} |
285 |
| - |
286 |
| -/* input area */ |
287 |
| -div.nbinput div.input_area { |
288 |
| - border: 1px solid #cfcfcf; |
289 |
| - border-radius: 2px; |
290 |
| - background: #f7f7f7; |
291 |
| -} |
292 |
| - |
293 |
| -/* override MathJax center alignment in output cells */ |
294 |
| -div.nboutput div[class*=MathJax] { |
295 |
| - text-align: left !important; |
296 |
| -} |
297 |
| - |
298 |
| -/* override sphinx.ext.pngmath center alignment in output cells */ |
299 |
| -div.nboutput div.math p { |
300 |
| - text-align: left; |
301 |
| -} |
302 |
| - |
303 |
| -/* standard error */ |
304 |
| -div.nboutput div.output_area.stderr { |
305 |
| - background: #fdd; |
306 |
| -} |
307 |
| - |
308 |
| -/* ANSI colors */ |
309 |
| -.ansi-black-fg { color: #3E424D; } |
310 |
| -.ansi-black-bg { background-color: #3E424D; } |
311 |
| -.ansi-black-intense-fg { color: #282C36; } |
312 |
| -.ansi-black-intense-bg { background-color: #282C36; } |
313 |
| -.ansi-red-fg { color: #E75C58; } |
314 |
| -.ansi-red-bg { background-color: #E75C58; } |
315 |
| -.ansi-red-intense-fg { color: #B22B31; } |
316 |
| -.ansi-red-intense-bg { background-color: #B22B31; } |
317 |
| -.ansi-green-fg { color: #00A250; } |
318 |
| -.ansi-green-bg { background-color: #00A250; } |
319 |
| -.ansi-green-intense-fg { color: #007427; } |
320 |
| -.ansi-green-intense-bg { background-color: #007427; } |
321 |
| -.ansi-yellow-fg { color: #DDB62B; } |
322 |
| -.ansi-yellow-bg { background-color: #DDB62B; } |
323 |
| -.ansi-yellow-intense-fg { color: #B27D12; } |
324 |
| -.ansi-yellow-intense-bg { background-color: #B27D12; } |
325 |
| -.ansi-blue-fg { color: #208FFB; } |
326 |
| -.ansi-blue-bg { background-color: #208FFB; } |
327 |
| -.ansi-blue-intense-fg { color: #0065CA; } |
328 |
| -.ansi-blue-intense-bg { background-color: #0065CA; } |
329 |
| -.ansi-magenta-fg { color: #D160C4; } |
330 |
| -.ansi-magenta-bg { background-color: #D160C4; } |
331 |
| -.ansi-magenta-intense-fg { color: #A03196; } |
332 |
| -.ansi-magenta-intense-bg { background-color: #A03196; } |
333 |
| -.ansi-cyan-fg { color: #60C6C8; } |
334 |
| -.ansi-cyan-bg { background-color: #60C6C8; } |
335 |
| -.ansi-cyan-intense-fg { color: #258F8F; } |
336 |
| -.ansi-cyan-intense-bg { background-color: #258F8F; } |
337 |
| -.ansi-white-fg { color: #C5C1B4; } |
338 |
| -.ansi-white-bg { background-color: #C5C1B4; } |
339 |
| -.ansi-white-intense-fg { color: #A1A6B2; } |
340 |
| -.ansi-white-intense-bg { background-color: #A1A6B2; } |
341 |
| - |
342 |
| -.ansi-default-inverse-fg { color: #FFFFFF; } |
343 |
| -.ansi-default-inverse-bg { background-color: #000000; } |
344 |
| - |
345 |
| -.ansi-bold { font-weight: bold; } |
346 |
| -.ansi-underline { text-decoration: underline; } |
347 |
| - |
348 | 184 | /* CSS overrides for sphinx_rtd_theme */
|
349 | 185 |
|
350 | 186 | /* 24px margin */
|
@@ -554,53 +390,6 @@ <h2>Why Python?<a class="headerlink" href="#Why-Python?" title="Permalink to thi
|
554 | 390 | <p>We will be relying heavily on Python and a library for doing optimized
|
555 | 391 | numerical computations, called NumPy, throughout this course.</p>
|
556 | 392 | </div>
|
557 |
| -<div class="section" id="A-Quick-Guide-to-Formatting"> |
558 |
| -<h2>A Quick Guide to Formatting<a class="headerlink" href="#A-Quick-Guide-to-Formatting" title="Permalink to this headline">¶</a></h2> |
559 |
| -<p>Here is a quick rundown of the formatting that will be used throughout |
560 |
| -this text.</p> |
561 |
| -<p>The following represents a block of Python code:</p> |
562 |
| -<div class="highlight-python"><div class="highlight"><pre><span></span><span class="c1"># count to 10</span> |
563 |
| -<span class="n">cnt</span> <span class="o">=</span> <span class="mi">0</span> |
564 |
| -<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">10</span><span class="p">):</span> |
565 |
| - <span class="n">cnt</span> <span class="o">+=</span> <span class="mi">1</span> |
566 |
| -</pre></div> |
567 |
| -</div> |
568 |
| -<p>Whenever the <code class="docutils literal"><span class="pre">>>></span></code> appears, it is used to distinguish Python code that |
569 |
| -is entered in a terminal (e.g. in the IPython console) from its output:</p> |
570 |
| -<div class="highlight-python"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="mi">2</span> <span class="o">+</span> <span class="mi">3</span> |
571 |
| -<span class="go">5</span> |
572 |
| -</pre></div> |
573 |
| -</div> |
574 |
| -<p>The pound-sign, <code class="docutils literal"><span class="pre">#</span></code>, is used to indicate a comment in Python code. Any |
575 |
| -text to the right of a <code class="docutils literal"><span class="pre">#</span></code> will be treated as a comment, and will not |
576 |
| -be interpreted as code:</p> |
577 |
| -<div class="highlight-python"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="mi">2</span> <span class="o">+</span> <span class="mi">3</span> <span class="c1"># this is all a comment, so it has no impact on the code!</span> |
578 |
| -<span class="go">5</span> |
579 |
| -</pre></div> |
580 |
| -</div> |
581 |
| -<p>Input and output to either the IPython console or a Jupyter notebook |
582 |
| -will be indicated as follows:</p> |
583 |
| -<div class="nbinput docutils container"> |
584 |
| -<div class="prompt highlight-none"><div class="highlight"><pre> |
585 |
| -<span></span>In [1]: |
586 |
| -</pre></div> |
587 |
| -</div> |
588 |
| -<div class="input_area highlight-ipython3"><div class="highlight"><pre> |
589 |
| -<span></span><span class="mi">2</span> <span class="o">+</span> <span class="mi">3</span> |
590 |
| -</pre></div> |
591 |
| -</div> |
592 |
| -</div> |
593 |
| -<div class="nboutput nblast docutils container"> |
594 |
| -<div class="prompt highlight-none"><div class="highlight"><pre> |
595 |
| -<span></span>Out[1]: |
596 |
| -</pre></div> |
597 |
| -</div> |
598 |
| -<div class="output_area highlight-none"><div class="highlight"><pre> |
599 |
| -<span></span>5 |
600 |
| -</pre></div> |
601 |
| -</div> |
602 |
| -</div> |
603 |
| -</div> |
604 | 393 | <div class="section" id="Summary">
|
605 | 394 | <h2>Summary<a class="headerlink" href="#Summary" title="Permalink to this headline">¶</a></h2>
|
606 | 395 | <ul class="simple">
|
@@ -637,7 +426,7 @@ <h2>Summary<a class="headerlink" href="#Summary" title="Permalink to this headli
|
637 | 426 | <a href="Installing_Python.html" class="btn btn-neutral float-right" title="Installing Python" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
|
638 | 427 |
|
639 | 428 |
|
640 |
| - <a href="../module_1.html" class="btn btn-neutral" title="Module 1: Getting Started with Python" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> |
| 429 | + <a href="SiteFormatting.html" class="btn btn-neutral" title="A Quick Guide to Formatting" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> |
641 | 430 |
|
642 | 431 | </div>
|
643 | 432 |
|
|
0 commit comments