-
Notifications
You must be signed in to change notification settings - Fork 8
Add python docs #108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
xeruf
wants to merge
4
commits into
main
Choose a base branch
from
add-python-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Add python docs #108
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
name: Java | ||
index: 3 | ||
expanded: false | ||
--- |
2 changes: 1 addition & 1 deletion
2
...book/entwicklung/installation-von-java.md → ...entwicklung/java/installation-von-java.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
name: Installation von Java | ||
index: 5 | ||
index: 1 | ||
--- | ||
|
||
# Installation von Java | ||
|
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
hyperbook/book/entwicklung/python/1-installation-von-python.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
--- | ||
name: Installation von Python | ||
index: 1 | ||
--- | ||
|
||
# Installation von Python | ||
|
||
Um einen Computerspieler für die Software-Challenge in Python entwickeln zu können, | ||
müssen einige Vorraussetzungen erfüllt sein. | ||
Diese Anleitung soll die Vorbereitung und Installation erleichtern. | ||
|
||
## Grundsätzliches | ||
|
||
Wir bieten die Abgabe eines Python Computerspieler in den Python-Versionen 3.10.x und 3.12.x an | ||
(dabei steht x für eine beliebige Unterversion). | ||
|
||
In den folgenden Abschnitten wird hauptsächlich die neuere Version 3.12.x gezeigt, aber wenn bei gewissen Befehlen | ||
`312` oder `3.12` verwendet wird, kann analog für Version 3.10.x auch `310` bzw `3.10` verwendet werden. | ||
Wenn es größere Unterschiede zwischen den Versionen gibt, wird das detailliert erklärt. | ||
|
||
## Installation | ||
|
||
Der Download des Python-Installers geschieht über die offizielle Seite der | ||
[Python Organisation](https://www.python.org/downloads/). | ||
Dort kann man weiter unten in einer Tabelle die neueste Unterversion von Python 3.12 heraussuchen | ||
und diese herunterladen. | ||
|
||
 | ||
|
||
Man wählt dann auf der Download-Seite den Installer für das eigene System und führt diesen nach dem Download aus. | ||
Im (Windows-)Installer hat man dann die Möglichkeit python.exe zu den Umgebungsvariablen (PATH) hinzuzufügen, | ||
was zu empfehlen ist. Dann kann man die einfache Installation starten. | ||
Dabei wird auch der Paket-Manager pip installiert, welcher in Zukunft noch gebraucht wird. | ||
|
||
### Überprüfung | ||
|
||
Nach der Installation kann man mit dem Terminal überprüfen, ob die Installation erfolgreich war. | ||
Dafür fragt man die Versionen der Programme Python und pip mit folgenden Befehlen ab: | ||
|
||
```bash | ||
python --version | ||
``` | ||
|
||
```bash | ||
pip --version | ||
``` | ||
|
||
Bei Python sollte die ausgewählte Version ausgegeben werden und für pip müsste irgendeine Version vorhanden sein, | ||
die mit einem Dateipfad auf den Ordner der installierten Python-Version verweist. | ||
|
||
Wenn das geklappt hat, ist man bereit für den nächsten Step. | ||
|
||
### socha-Paket | ||
|
||
Um nun auf die bereitgestellte Schnittstelle für einen Python Computerspieler zugreifen zu können, | ||
muss das entsprechende Paket mit Hilfe von pip und folgendem Befehl über ein Terminal installiert werden: | ||
|
||
```bash | ||
pip install socha | ||
``` | ||
|
||
Dabei sollte automatisch die neueste Version verwendet werden, | ||
welche in der Release Übersicht des offiziellen [Github-Repository](https://github.com/software-challenge/player-python/) | ||
zur Python Schnittstelle gefunden werden kann: | ||
|
||
 | ||
|
||
Falls nicht die aktuelleste Version installiert wurde, kann man den Befehl auch erweitern, | ||
um eine spezielle Version auszuwählen (natürlich Version entsprechend anpassen): | ||
|
||
```bash | ||
pip install socha==3.6.2 | ||
``` |
48 changes: 48 additions & 0 deletions
48
hyperbook/book/entwicklung/python/2-einrichtung-der-entwicklungsumgebung.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
name: Einrichtung der Entwicklungsumgebung | ||
index: 2 | ||
--- | ||
|
||
# Einrichtung der (Python-)Entwicklungsumgebung | ||
|
||
Python Code lässt sich mit jedem Text Editor schreiben. | ||
Wenn man weitere nützliche Features neben dem einfachen Editor haben möchte, | ||
sollte man zu einer integrierten Entwicklungsumgebung (IDE) greifen, | ||
welche das Arbeiten wirklich erleichtert. | ||
|
||
Im Folgenden wird die Einrichtung von [Visual Studio Code](https://code.visualstudio.com/) | ||
(eine IDE von Microsoft, die für sämtliche Sprachen geeignet ist) gezeigt. | ||
Aber auch Umgebungen wie [PyCharm](https://www.jetbrains.com/pycharm/), | ||
welche ausschließlich für Python entworfen wurden, sind beliebt. | ||
|
||
**Hinweis:** Bevor die IDE eingerichtet wird, sollten [Python und pip](installation-von-python) erfolgreich | ||
installiert sein. | ||
|
||
## Visual Studio Code einrichten | ||
|
||
### Installation | ||
|
||
Die einfachste Installation geschieht mit Hilfe des VS Code Installers von | ||
der [Download-Seite](https://code.visualstudio.com/Download). \ | ||
Nachdem man den die Installer Datei heruntergeladen hat, | ||
gelangt man im Browser auf eine [Seite](https://code.visualstudio.com/docs/), | ||
die das Aufsetzen sehr detailliert erklärt. | ||
|
||
Die wichtigsten Schritte bzgl. der Software-Challenge werden hier noch erklärt: | ||
|
||
#### Installer | ||
|
||
Der Installer wird ausgeführt und alle Features, die installiert werden sollen, | ||
müssen auswählt werden. Dabei lassen sich alle Optionen empfehlen. | ||
|
||
### Python in VS Code | ||
|
||
Um die angespochenen Unterstützungen für Python nutzen zu können, | ||
muss man in VS Code eine Erweiterung installieren: | ||
|
||
1. Im linken Menü auf "Extensions" gehen | ||
2. Nach "Python" suchen | ||
3. Die "Python" Erweiterung von Microsoft auswählen | ||
4. Das Paket installieren | ||
|
||
 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.