mirror of
https://github.com/kennethreitz/dive-into-python3.git
synced 2026-06-05 23:10:17 +00:00
class=nd fiddling
This commit is contained in:
Regular → Executable
+6
-6
@@ -36,7 +36,7 @@ h2,.i>li{clear:both}
|
||||
|
||||
<p>Once you’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’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’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’s lots more you can do in the Python shell. If you ever get stuck — you can’t remember a command, or you can’t remember the proper arguments to pass a certain function — 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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user