You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>It is also possible to invoke pip directly using the command <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">pip3</span></code>,
@@ -131,7 +131,7 @@ <h3><span class="section-number">2.2.1. </span>Installing packages from PyPI<a c
131
131
likely that pip will install more packages than those you directly
132
132
asked for. This is necessary if those packages are to actually work.</p>
133
133
<p>Pip can also be used to upgrade a package to the latest version:</p>
disk from the text editor, we can now run the program. Open a
232
232
terminal, and change to the folder (directory) where you saved
233
233
<codeclass="file docutils literal notranslate"><spanclass="pre">hello.py</span></code>. For example, if <codeclass="file docutils literal notranslate"><spanclass="pre">hello.py</span></code> is in the directory <codeclass="file docutils literal notranslate"><spanclass="pre">src</span></code> in
234
-
your home directory, then you would type the following:</p>
234
+
your home directory, then on most operating systems, you would type the following:</p>
<p>The dollar sign is the command prompt. Its different on some systems,
240
-
for example, it’s often a greater than sign (<codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">></span></code>). The text to the left
241
-
of the command prompt might also be different depending on which
242
-
terminal program you are using on which operating system, but we are
243
-
only concerned with the commands to the right of the prompt. The first
244
-
of these, <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">cd</span></code> (<em>change directory</em>) switches the current folder to
245
-
<codeclass="file docutils literal notranslate"><spanclass="pre">src</span></code>. The second command actually runs the Python interpreter on
246
-
<codeclass="file docutils literal notranslate"><spanclass="pre">hello.py</span></code>. Depending on what is installed on your computer, it might
247
-
also be possible to leave off the <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">3</span></code> at the end of <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">python3</span></code>, however
248
-
on some systems the plain <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">python</span></code> command is still linked to the old
249
-
version 2 of Python, so it’s better to be explicit and type
250
-
<codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">python3</span></code>. When we press the <kbdclass="kbd docutils literal notranslate">enter</kbd> key after the last line above,
251
-
our tiny Python script <codeclass="file docutils literal notranslate"><spanclass="pre">hello.py</span></code> runs and the following is displayed:</p>
<p>The dollar sign is the command prompt. Its different on some systems, for
245
+
example, it’s often a greater than sign (<codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">></span></code>). The text to the left of the
246
+
command prompt might also be different depending on which terminal program you
247
+
are using on which operating system, but we are only concerned with the commands
248
+
to the right of the prompt. The first of these, <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">cd</span></code> (<em>change directory</em>)
249
+
switches the current folder to <codeclass="file docutils literal notranslate"><spanclass="pre">src</span></code>. The second command actually runs the
250
+
Python interpreter on <codeclass="file docutils literal notranslate"><spanclass="pre">hello.py</span></code>. Depending on what is installed on your
251
+
computer, it might also be possible to leave off the <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">3</span></code> at the end of
252
+
<codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">python3</span></code>, however on some systems the plain <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">python</span></code> command is still linked to
253
+
the old version 2 of Python, so it’s better to be explicit and type <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">python3</span></code>.
254
+
Once we start working with Python <aclass="reference internal" href="#term-virtual-environment"><spanclass="xref std std-term">virtual environments</span></a>, it will always be safe to use <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">python</span></code> without the 3. When we
255
+
press the <kbdclass="kbd docutils literal notranslate">enter</kbd> key after the last line above, our tiny Python script
256
+
<codeclass="file docutils literal notranslate"><spanclass="pre">hello.py</span></code> runs and the following is displayed:</p>
<p>replacing <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">folder</span></code> with the name of the top-level folder of your
concepts are largely similar so rather than get bogged down in the
648
653
details of multiple frameworks, we will introduce <aclass="reference external" href="https://docs.pytest.org/en/latest/index.html" title="(in pytest v6.3.0.dev93+g42d5545f4)"><spanclass="xref std std-doc">pytest</span></a>, which is one of the most widely used. Pytest is simply a Python
649
654
package, so you can install it into your current environment using:</p>
<h3><spanclass="section-number">4.2.2. </span>Installing flake8<aclass="headerlink" href="#installing-flake8" title="Permalink to this headline">¶</a></h3>
197
197
<p>Flake8 is a Python package, which can be installed using pip. Make sure you’ve
198
198
activated your <aclass="reference internal" href="2_programs_in_files.html#term-virtual-environment"><spanclass="xref std std-term">virtual environment</span></a> and then run:</p>
<p>Because <codeclass="xref py py-mod docutils literal notranslate"><spanclass="pre">ipdb</span></code> does not form a part of the standard library, you
89
89
may not always find it installed by default. However, it’s simply a
0 commit comments