Skip to content

Commit 5980d37

Browse files
author
ghp_import
committed
Deploying 🙌
0 parents  commit 5980d37

File tree

17,191 files changed

+4310202
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

17,191 files changed

+4310202
-0
lines changed

.nojekyll

Whitespace-only changes.

2017/index.html

Lines changed: 399 additions & 0 deletions
Large diffs are not rendered by default.

2017/mipyt-kam/beginners/cmdline/index.html

Lines changed: 401 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
2+
<!doctype html>
3+
<html lang="cs">
4+
<head>
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
7+
<title>
8+
9+
MI-PYT (Pokročilý Python) beta pro KAM: Úvod do příkazové řádky
10+
11+
</title>
12+
13+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">
14+
15+
16+
17+
<link rel="stylesheet" href="/static/css/naucse.css">
18+
<link rel="stylesheet" href="/static/css/body.css">
19+
<link rel="stylesheet" href="/static/css/pygments-lovelace-style.css">
20+
<link rel="stylesheet" href="/static/css/ipython.css">
21+
22+
23+
<link rel="canonical" href="https://naucse.python.cz/lessons/beginners/cmdline/" />
24+
25+
26+
<style>
27+
28+
29+
30+
</style>
31+
</head>
32+
33+
<body>
34+
<nav class="header">
35+
<ul class="container menu">
36+
<li><a href="/" class="logo"><h1>Nauč se Python!</h1></a></li>
37+
<li><a href="/courses/" class="menu-link"><h2>Materiály</h2></a></li>
38+
<li><a href="/runs/" class="menu-link"><h2>Kurzy</h2></a></li>
39+
</ul>
40+
</nav>
41+
42+
43+
44+
<div class="page">
45+
<div class="container">
46+
47+
48+
<header class="lesson-header">
49+
<a href="/">Nauč se Python </a>
50+
51+
> <a href="/runs/">Kurzy</a>
52+
53+
54+
55+
> <a href="/2017/mipyt-kam/">MI-PYT (Pokročilý Python) beta pro KAM</a>
56+
57+
> <a href="/2017/mipyt-kam/beginners/cmdline/">Úvod do příkazové řádky</a>
58+
59+
60+
<hr>
61+
</header>
62+
63+
64+
65+
66+
67+
68+
<div class="lesson-content">
69+
70+
71+
<h1>Úvod do příkazové řádky – Řešení [0]</h1>
72+
73+
74+
<div class="row side-by-side-commands"><div class="col">
75+
<h4>Unix</h4><div class="highlight"><pre><span></span><span class="gp">$ </span><span class="nb">cd</span> naucse-python
76+
<span class="gp">$ </span>mkdir <span class="nb">test</span>
77+
<span class="gp">$ </span>ls
78+
<span class="go">test</span>
79+
</pre></div></div><div class="col">
80+
<h4>Windows</h4><div class="highlight"><pre><span></span><span class="gp">&gt; </span>cd naucse-python<span class="gp"></span>
81+
<span class="gp">&gt; </span>mkdir test<span class="gp"></span>
82+
<span class="gp">&gt; </span>dir
83+
<span class="go">05/08/2014 07:28 PM &lt;DIR&gt; test</span>
84+
</pre></div></div></div>
85+
86+
87+
</div>
88+
89+
90+
91+
</div>
92+
</div>
93+
94+
95+
96+
<script type="text/javascript" src="/static/js/solutions.js"></script>
97+
98+
<div class="footer container">
99+
<hr>
100+
<div class="lesson-attribution">
101+
102+
<p>
103+
Uprav tuto stránku na
104+
<a href="https://github.com/pyvec/naucse.python.cz/blob/archive/2017-mipyt-kam/lessons/beginners/cmdline/index.md">
105+
106+
<svg class="icon icon-github" viewBox="0 0 64 64">
107+
<path d="M32 0 C14 0 0 14 0 32 0 53 19 62 22 62 24 62 24 61 24 60 L24 55 C17 57 14 53 13 50 13 50 13 49 11 47 10 46 6 44 10 44 13 44 15 48 15 48 18 52 22 51 24 50 24 48 26 46 26 46 18 45 12 42 12 31 12 27 13 24 15 22 15 22 13 18 15 13 15 13 20 13 24 17 27 15 37 15 40 17 44 13 49 13 49 13 51 20 49 22 49 22 51 24 52 27 52 31 52 42 45 45 38 46 39 47 40 49 40 52 L40 60 C40 61 40 62 42 62 45 62 64 53 64 32 64 14 50 0 32 0 Z" fill="currentColor" stroke-width="0"/>
108+
</svg>
109+
110+
GitHubu
111+
</a>
112+
</p>
113+
114+
115+
116+
117+
<p>Pro PyLadies Brno napsal Petr Viktorin, 2014-2017.</p>
118+
119+
<p>Založeno na tutoriálu <a href="https://tutorial.djangogirls.org/en/intro_to_command_line/">Django Girls</a>.</p>
120+
121+
122+
123+
<p>
124+
Licence:
125+
<a href="https://creativecommons.org/licenses/by-sa/4.0/">
126+
Creative Commons Attribution-ShareAlike 4.0 International
127+
</a>
128+
</p>
129+
130+
131+
132+
</div>
133+
</div>
134+
135+
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
136+
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js" integrity="sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh" crossorigin="anonymous"></script>
137+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js" integrity="sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ" crossorigin="anonymous"></script>
138+
139+
140+
141+
</body>
142+
</html>
23.3 KB
Loading
Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
2+
<!doctype html>
3+
<html lang="cs">
4+
<head>
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
7+
<title>
8+
9+
MI-PYT (Pokročilý Python) beta pro KAM: První krůčky
10+
11+
</title>
12+
13+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">
14+
15+
16+
17+
<link rel="stylesheet" href="/static/css/naucse.css">
18+
<link rel="stylesheet" href="/static/css/body.css">
19+
<link rel="stylesheet" href="/static/css/pygments-lovelace-style.css">
20+
<link rel="stylesheet" href="/static/css/ipython.css">
21+
22+
23+
<link rel="canonical" href="https://naucse.python.cz/lessons/beginners/first-steps/" />
24+
25+
26+
<style>
27+
28+
29+
30+
</style>
31+
</head>
32+
33+
<body>
34+
<nav class="header">
35+
<ul class="container menu">
36+
<li><a href="/" class="logo"><h1>Nauč se Python!</h1></a></li>
37+
<li><a href="/courses/" class="menu-link"><h2>Materiály</h2></a></li>
38+
<li><a href="/runs/" class="menu-link"><h2>Kurzy</h2></a></li>
39+
</ul>
40+
</nav>
41+
42+
43+
44+
<div class="page">
45+
<div class="container">
46+
47+
48+
<header class="lesson-header">
49+
<a href="/">Nauč se Python </a>
50+
51+
> <a href="/runs/">Kurzy</a>
52+
53+
54+
55+
> <a href="/2017/mipyt-kam/">MI-PYT (Pokročilý Python) beta pro KAM</a>
56+
57+
> <a href="/2017/mipyt-kam/beginners/first-steps/">První krůčky</a>
58+
59+
60+
<hr>
61+
</header>
62+
63+
64+
65+
66+
67+
68+
<div class="lesson-content">
69+
70+
71+
72+
<h2>První příkazy v Pythonu</h2>
73+
<p>Pojďme si vyzkoušet, že nainstalovaný Python funguje!</p>
74+
<p>Zkontroluj si, že máš aktivované virtuální prostředí (na začátku příkazové
75+
řádky ti svítí <code>(venv)</code>).</p>
76+
<p>Je-li tomu tak, nezbývá než – konečně – pustit Python.
77+
K tomu použij příkaz <code>python</code>:</p>
78+
<div class="highlight"><pre><code>(venv)$ python
79+
Python 3.4.0 (default, Jan 26 2014, 18:15:05)
80+
[GCC 4.8.2 20131212 (Red Hat 4.8.2-7)] on linux
81+
Type "help", "copyright", "credits" or "license" for more information.
82+
&gt;&gt;&gt;</code></pre></div><p>Příkaz vypíše několik informací.
83+
Z prvního řádku se můžeš ujistit, že používáš Python 3.
84+
Třemi „zobáčky“ <code>&gt;&gt;&gt;</code> pak Python poprosí o instrukce.
85+
Je to jako v příkazové řádce, ale místo příkazů jako
86+
<code>cd</code> a <code>mkdir</code> sem budeš psát příkazy Pythonu.</p>
87+
<p>Nejjednodušší příkaz Pythonu je prosté číslo. Zkus to:</p>
88+
<div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="mi">1</span>
89+
<span class="go">1</span>
90+
<span class="gp">&gt;&gt;&gt; </span><span class="mi">42</span>
91+
<span class="go">42</span>
92+
<span class="gp">&gt;&gt;&gt; </span><span class="o">-</span><span class="mf">8.3</span> <span class="c1"># (Python používá desetinnou tečku)</span>
93+
<span class="go">-8.3</span>
94+
</pre></div><div class="admonition note"><p>Zobáčky <code>&gt;&gt;&gt;</code> i odpověď vypisuje sám Python!
95+
sám/sama zadej jen číslo a Enter.</p>
96+
</div><p>Čísla umí Python i sečítat. Třeba takhle:</p>
97+
<div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="mi">8</span> <span class="o">+</span> <span class="mi">2</span>
98+
<span class="go">10</span>
99+
</pre></div><p>Všimni si, že příkazy z příkazové řádky v Pythonu nefungují,
100+
ačkoli okýnko vypadá skoro stejně:</p>
101+
<div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">whoami</span>
102+
<span class="gt">Traceback (most recent call last):</span>
103+
File <span class="nb">"&lt;stdin&gt;"</span>, line <span class="m">1</span>, in <span class="n">&lt;module&gt;</span>
104+
<span class="gr">NameError</span>: <span class="n">name 'whoami' is not defined</span>
105+
</pre></div><p>Tohle je <em>chybová hláška</em>, která se objeví vždycky,
106+
když uděláš něco špatně.
107+
V průběhu kurzu jich uvidíš ještě spoustu,
108+
takže si ji dobře prohlédni, ať ji příště poznáš.</p>
109+
<p>Pokud ses dostal/a až sem, gratuluji!
110+
Python máš nejen nainstalovaný, ale taky ti funguje.
111+
Stačí ho už jen zavřít a pak opustit i samotnou příkazovou řádku.
112+
V Pythonu se to dělá pomocí <code>quit()</code>, s prázdnými závorkami na konci.</p>
113+
<div class="highlight"><pre>
114+
<span class="gp">&gt;&gt;&gt;</span> quit()
115+
<span class="gp">(venv)$</span>
116+
</pre></div><p>Zobáčky <code>&gt;&gt;&gt;</code> se změnily na výzvu
117+
příkazové řádky (která začíná <code>(venv)</code> a končí <code>$</code> nebo <code>&gt;</code>).
118+
Teď fungují příkazy jako <code>whoami</code> a <code>cd</code>, ale příkazy Pythonu
119+
jako <code>1 + 2</code> fungovat nebudou, dokud Python opět nepustíš pomocí
120+
příkazu <code>python</code>.</p>
121+
<p>Ukončit virtuální prostředí můžeš příkazem <code>deactivate</code>
122+
tentokrát bez závorek.</p>
123+
<div class="highlight"><pre><span></span><span class="gp gp-VirtualEnv">(venv)</span><span class="gp">$ </span>deactivate
124+
</pre></div><p>Příkazovou řádku můžeš nakonec zavřít příkazem <code>exit</code>.</p>
125+
<div class="highlight"><pre><span></span><span class="gp">$ </span><span class="nb">exit</span>
126+
</pre></div><p>Pro cvik si zkus Python znovu spustit – nejdřív otevři příkazovou řádku,
127+
pak aktivuj virtuální prostředí, potom spusť Python samotný.</p>
128+
129+
130+
</div>
131+
132+
133+
134+
</div>
135+
</div>
136+
137+
138+
139+
<script type="text/javascript" src="/static/js/solutions.js"></script>
140+
141+
<div class="footer container">
142+
<hr>
143+
<div class="lesson-attribution">
144+
145+
<p>
146+
Uprav tuto stránku na
147+
<a href="https://github.com/pyvec/naucse.python.cz/blob/archive/2017-mipyt-kam/lessons/beginners/first-steps/index.md">
148+
149+
<svg class="icon icon-github" viewBox="0 0 64 64">
150+
<path d="M32 0 C14 0 0 14 0 32 0 53 19 62 22 62 24 62 24 61 24 60 L24 55 C17 57 14 53 13 50 13 50 13 49 11 47 10 46 6 44 10 44 13 44 15 48 15 48 18 52 22 51 24 50 24 48 26 46 26 46 18 45 12 42 12 31 12 27 13 24 15 22 15 22 13 18 15 13 15 13 20 13 24 17 27 15 37 15 40 17 44 13 49 13 49 13 51 20 49 22 49 22 51 24 52 27 52 31 52 42 45 45 38 46 39 47 40 49 40 52 L40 60 C40 61 40 62 42 62 45 62 64 53 64 32 64 14 50 0 32 0 Z" fill="currentColor" stroke-width="0"/>
151+
</svg>
152+
153+
GitHubu
154+
</a>
155+
</p>
156+
157+
158+
159+
160+
<p>Pro PyLadies Brno napsal Petr Viktorin, 2014-2017.</p>
161+
162+
163+
164+
<p>
165+
Licence:
166+
<a href="https://creativecommons.org/licenses/by-sa/4.0/">
167+
Creative Commons Attribution-ShareAlike 4.0 International
168+
</a>
169+
</p>
170+
171+
172+
173+
</div>
174+
</div>
175+
176+
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
177+
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js" integrity="sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh" crossorigin="anonymous"></script>
178+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js" integrity="sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ" crossorigin="anonymous"></script>
179+
180+
181+
182+
</body>
183+
</html>

0 commit comments

Comments
 (0)