lehrkraefte:blc:informatik:glf22:python:graphics

This is an old revision of the document!


Simple Grafik mit graphics.py

Installieren Sie zuerst das nötige Paket, siehe unten.

Dokumentation als Webseite oder als pdf.

Setup

Auf der Komandozeile (egal in welchem Ordner):

pip install graphics.py

Unter Linux/Mac ist pip3 anstatt pip zu verwenden.

Beispiel-Programm zum testen:

from graphics import *
 
win = GraphWin("Hello", 600, 600)
text = Text(Point(100,300), "It works")
text.setSize(36)
text.draw(win)
win.getMouse() # Pause to view result
win.close()    # Close window when done

Sollte dieser Code noch nicht funktionieren (Linux/Mac), ist noch folgender Befehl in der git-bash nötig:

pip3 install tk
  • lehrkraefte/blc/informatik/glf22/python/graphics.1668596761.txt.gz
  • Last modified: 2022/11/16 12:06
  • by Ivo Blöchliger