Python 2 hour intro: Difference between revisions
Content added Content deleted
imported>Jesstess No edit summary |
imported>Jesstess |
||
Line 327: | Line 327: | ||
<ol> |
<ol> |
||
<li>Download the file http://mit.edu/jesstess/www/BostonPythonWorkshop6/nobel.py by right-clicking on it and saying to save it as a ".py" file to your Desktop. The ".py" extension hints that this is a Python script.</li> |
<li>Download the file http://mit.edu/jesstess/www/BostonPythonWorkshop6/nobel.py by right-clicking on it and saying to save it as a ".py" file to your Desktop. The ".py" extension hints that this is a Python script.</li> |
||
<li>Run the script by double-clicking on it. What happens?</li> |
|||
<li>Open a command prompt, and use the navigation commands (<code>dir</code> and <code>cd</code> on Windows, <code>ls</code>, <code>pwd</code>, and <code>cd</code> on OS X and Linux) to navigate to your home directory. See [[Boston Python Workshop 6/Friday#Goal_.234:_practice_navigating_the_computer_from_a_command_prompt|navigating from a command prompt]] for a refresher on those commands.</li> |
|||
<li>Once you are in your home directory, execute the contents of <code>nobel.py</code> by typing |
|||
<pre> |
|||
python nobel.py |
|||
</pre> |
|||
at a command prompt. |
|||
<code>nobel.py</code> introduces two new concepts: comments and multiline strings.</li> |
<code>nobel.py</code> introduces two new concepts: comments and multiline strings.</li> |
||
<li>Open <code>nobel.py</code> in |
<li>Open <code>nobel.py</code> in a text editor.</li> |
||
<li>Read through the file in your text editor carefully and check your understanding of both the comments and the code.</li> |
<li>Read through the file in your text editor carefully and check your understanding of both the comments and the code.</li> |
||
</ol> |
</ol> |
||
Line 349: | Line 342: | ||
</ol> |
</ol> |
||
Let's get back to some interactive examples. |
Let's get back to some interactive examples. |
||
==Booleans== |
==Booleans== |