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
<h3>Eine Konsole unter Windows öffnen<aclass="headerlink" href="#opening-a-console-on-windows" title="Permalink zu dieser Überschrift">¶</a></h3>
111
-
<p>Die Konsole in Windows wird Kommandozeilenaufforderung genannt, oder <strongclass="program">cmd</strong>. Ein einfacher Weg sie zu öffnen ist durch das Tastenkürzel “Windows+R” (wobei ‘Windows’ den Knopf mit dem Windows-Logo meint), welches einen ‘Ausführen’-Dialog öffnen sollte. Tippe dann <ahref="#id1"><spanclass="problematic" id="id2">:kdb:`cmd`</span></a> und drück :kbd:<ahref="#id3"><spanclass="problematic" id="id4">`</span></a>Enter`oder klick Ok. Du kannst danach auch im Startmenü suchen. Es sollte wie folgt aussehen:</p>
111
+
<p>Window’s console is called the Command Prompt, named <strongclass="program">cmd</strong>. An easy
112
+
way to get to it is by using the key combination <ttclass="kbd docutils literal"><spanclass="pre">Windows+R</span></tt>
113
+
(<ttclass="kbd docutils literal"><spanclass="pre">Windows</span></tt> meaning the windows logo button), which should open a
114
+
<emclass="guilabel">Run</em> dialog. Then type <strongclass="program">cmd</strong> and hit <ttclass="kbd docutils literal"><spanclass="pre">Enter</span></tt> or
115
+
click <emclass="guilabel">Ok</em>. You can also search for it from the start menu. It should
@@ -118,7 +123,8 @@ <h3>Eine Konsole unter Windows öffnen<a class="headerlink" href="#opening-a-con
118
123
<divclass="section" id="using-python">
119
124
<h2>Python verwenden<aclass="headerlink" href="#using-python" title="Permalink zu dieser Überschrift">¶</a></h2>
120
125
<p>Das Pythonprogramm das du installiert hast agiert standardmäßig als etwas das sich <strong>Interpreter</strong> nennt. Ein Interpreter nimmt Befehle entgegen und führt sie dann aus – sehr praktisch um Dinge auszuprobieren.</p>
121
-
<p>Tippe in Deiner Konsole ein <strongclass="program">python</strong>, drücke <ahref="#id1"><spanclass="problematic" id="id2">:kdb:`<Enter>`</span></a>, und der Python-Interpreter sollte starten.</p>
126
+
<p>Just type <strongclass="program">python</strong> at your console, hit <ttclass="kbd docutils literal"><spanclass="pre">Enter</span></tt>, and you should
127
+
enter Python’s Interpreter.</p>
122
128
<p>Um herauszufinden welche Version von Python du hast, benutz <ttclass="docutils literal"><spanclass="pre">python</span><spanclass="pre">-V</span></tt> um es dir sagen zu lassen.</p>
123
129
<divclass="section" id="interacting-with-python">
124
130
<h3>Mit Python interagieren<aclass="headerlink" href="#interacting-with-python" title="Permalink zu dieser Überschrift">¶</a></h3>
<p>Drücke :kbd:’<Enter>’ und sieh was passiert. Nachdem Python Dir die Ergebnisse angezeigt hat, gelangst Du zurück zum interaktiven Prompt wo Du einen weiteren Befehl eingeben kannst:</p>
146
+
<p>Press <ttclass="kbd docutils literal"><spanclass="pre">Enter</span></tt> and see what happens. After showing the results, Python
147
+
will bring you back to the interactive prompt, where you could enter
<h3>Pythonprogramme ausführen<aclass="headerlink" href="#running-python-files" title="Permalink zu dieser Überschrift">¶</a></h3>
152
160
<p>Falls du viel Pythonquelltext auszuführen hast wirst du ihn in eine Datei speichern wollen damit du zum Beispiel kleine Stücke verändern kannst (einen Fehler beheben) und es nochmal ausführen kannst ohne den Rest wieder und wieder einzutippen. Stattdessen kannst du deinen Quelltext in eine Datei speichern und den Dateinamen an das <strongclass="program">python</strong>-Programm liefern. Es wird dann diese Datei ausführen statt den interaktiven Interpreter auszuführen.</p>
153
-
<p><strong>Lass uns das ausprobieren</strong>. Erstelle eine Datei <ttclass="file docutils literal"><spanclass="pre">hello.py</span></tt> in deinem aktuellen Verzeichnis mit deinem Lieblingseditor und schreibe den print-Befehl von oben. Jetzt speicher die Datei. Unter Linux und OS X kannst du auch <ahref="#id1"><spanclass="problematic" id="id2">:kdb:`touch hello.py`</span></a> ausführen um eine leere Datei zu erstellen. Diese Datei mit Python auszuführen ist ganz einfach:</p>
161
+
<p><strong>Let’s try that</strong>. Create a file <ttclass="file docutils literal"><spanclass="pre">hello.py</span></tt> in your current directory
162
+
with your favorite text editor and write the print command from above. Now
163
+
save that file. On Linux or OS X, you can also run <ttclass="docutils literal"><spanclass="pre">touch</span><spanclass="pre">hello.py</span></tt> to create
164
+
an empty file to edit. To run this file with python, it’s pretty easy:</p>
<pclass="last">Versichere dich, dass du dich in der Kommandozeile befindest, die du an <ttclass="docutils literal"><spanclass="pre">$</span></tt> oder <ttclass="docutils literal"><spanclass="pre">></span></tt> am Ende erkennst, nicht in Pythons (welche <ttclass="docutils literal"><spanclass="pre">>>></span></tt> hat).</p>
160
171
</div>
161
172
<p>Unter Windows solltest du doppelt auf die Pythondatei klicken können um sie auszuführen.</p>
162
-
<p>Wenn Du nun :kbd:’<Enter>’ drückst, wird das Programm in der Datei ausgeführt, und Du siehst die gleiche Ausgabe wie zuvor. Aber diesmal kehrt Python nach Ausführen der Befehle in der Datei zurück zur Kommandozeile Deines Betriebssystems anstatt in den Interpreter.</p>
173
+
<p>When pressing <ttclass="kbd docutils literal"><spanclass="pre">Enter</span></tt> now, the file is executed and you see the output
174
+
as before. But this time, after Python finished executing all commands from
175
+
that file it exits back to the system command prompt, instead of going back
176
+
to the interactive shell.</p>
163
177
<p>Wir sind jetzt startklar und können mit der Schildkröte anfangen!</p>
0 commit comments