class=nd fiddling

This commit is contained in:
Mark Pilgrim
2009-07-14 20:51:14 -04:00
parent d5af08d0cb
commit 07ced98b41
14 changed files with 121 additions and 139 deletions
Regular → Executable
+6 -6
View File
@@ -36,7 +36,7 @@ h2,.i>li{clear:both}
<p>Once you&#8217;re at a command line prompt, just type <kbd>python3</kbd> (all lowercase, no spaces) and see what happens. On my home Linux system, Python 3 is already installed, and this command gets me into the <i>Python <dfn>interactive shell</dfn></i>.
<pre class=screen>
<pre class='nd screen'>
<samp class=p>mark@atlantis:~$ </samp><kbd>python3</kbd>
<samp>Python 3.0.1+ (r301:69556, Apr 15 2009, 17:25:52)
[GCC 4.3.3] on linux2
@@ -47,7 +47,7 @@ Type "help", "copyright", "credits" or "license" for more information.
<p>My <a href=http://cornerhost.com/>web hosting provider</a> also runs Linux and provides command-line access, but my server does not have Python 3 installed. (Boo!)
<pre class=screen>
<pre class='nd screen'>
<samp class=p>mark@manganese:~$ </samp><kbd>python3</kbd>
<samp>bash: python3: command not found</samp></pre>
@@ -274,7 +274,7 @@ Type "help", "copyright", "credits" or "license" for more information.
<p>First things first. The Python Shell itself is an amazing interactive playground. Throughout this book, you&#8217;ll see examples like this:
<pre class=screen>
<pre class='nd screen'>
<samp class=p>>>> </samp><kbd class=pp>1 + 1</kbd>
<samp class=pp>2</samp></pre>
@@ -286,14 +286,14 @@ Type "help", "copyright", "credits" or "license" for more information.
<p>Let&#8217;s try another one.
<pre class=screen>
<pre class='nd screen'>
<samp class=p>>>> </samp><kbd class=pp>print('Hello world!')</kbd>
<samp>Hello world!</samp>
</pre>
<p>Pretty simple, no? But there&#8217;s lots more you can do in the Python shell. If you ever get stuck&nbsp;&mdash;&nbsp;you can&#8217;t remember a command, or you can&#8217;t remember the proper arguments to pass a certain function&nbsp;&mdash;&nbsp;you can get interactive help in the Python Shell. Just type <kbd>help</kbd> and press <kbd>ENTER</kbd>.
<pre class=screen>
<pre class='nd screen'>
<samp class=p>>>> </samp><kbd>help</kbd>
<samp>Type help() for interactive help, or help(object) for help about object.</samp></pre>
@@ -301,7 +301,7 @@ Type "help", "copyright", "credits" or "license" for more information.
<p>To enter the interactive help mode, type <kbd>help()</kbd> and press <kbd>ENTER</kbd>.
<pre class=screen>
<pre class='nd screen'>
<samp class=p>>>> </samp><kbd class=pp>help()</kbd>
<samp>Welcome to Python 3.0! This is the online help utility.