Benutzer-Werkzeuge

Webseiten-Werkzeuge


prog:python:language

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
prog:python:language [2020/12/31 16:59] – [Threads] adminprog:python:language [2023/08/14 17:13] (aktuell) – [Besonderheiten der Sprache] admin
Zeile 1: Zeile 1:
 ====== Python Sprachkonstrukte (Klassen, Definitionen, etc.) ====== ====== Python Sprachkonstrukte (Klassen, Definitionen, etc.) ======
  
 +
 +==== Besonderheiten der Sprache ====
 +
 +  * [[https://eli.thegreenplace.net/2015/the-scope-of-index-variables-in-pythons-for-loops/|The scope of index variables in Python's for loops]]
 +  * [[https://geekflare.com/python-unpacking-operators/|How to Use the Unpacking Operators (*, **) in Python]] 
  
 ==== Klassen und Methoden ==== ==== Klassen und Methoden ====
Zeile 33: Zeile 38:
  
 ==== Lists ==== ==== Lists ====
 +
 + * [[https://stackoverflow.com/questions/8653516/python-list-of-dictionaries-search#comment18634157_8653568|Search in a list of dictionaries (such as a JSON representation)]]
  
 Liste mit bestimmten Elementen erzeugen: Liste mit bestimmten Elementen erzeugen:
  
 <code python list.py> <code python list.py>
-l = [None]*10 #Leere Liste mit 10 Elementen+l = [None]*10 # Leere Liste mit 10 Elementen
 l = list(range(1,11)) # Liste mit Werten von 1-10 l = list(range(1,11)) # Liste mit Werten von 1-10
 +# unpacking a range object into a list with the unpack operator (*)
 +r = range(1,11,2)
 +l = [*r]
 +first, *_, last = [1, 2, 3, 5, 7] # first = 1, last = 7
 </code> </code>
 +
  
 ==== Threads ==== ==== Threads ====
Zeile 45: Zeile 57:
   * [[https://realpython.com/intro-to-python-threading/|An Intro to Threading in Python]]   * [[https://realpython.com/intro-to-python-threading/|An Intro to Threading in Python]]
   * https://docs.python.org/3/library/threading.html   * https://docs.python.org/3/library/threading.html
 +  * https://hackernoon.com/synchronization-primitives-in-python-564f89fee732 Let’s Synchronize Threads in Python
  
 ==Beispiele== ==Beispiele==
Zeile 59: Zeile 72:
   * [[https://stackoverflow.com/questions/11334447/monitor-thread-synchronization-in-python|Monitor Thread synchronization mit Lock()]]   * [[https://stackoverflow.com/questions/11334447/monitor-thread-synchronization-in-python|Monitor Thread synchronization mit Lock()]]
   * https://stackoverflow.com/questions/41441900/how-to-synchronize-python-threads   * https://stackoverflow.com/questions/41441900/how-to-synchronize-python-threads
 +  * [[https://pymotw.com/2/Queue/|Queue – A thread-safe FIFO implementation]]
  
 ==== Decorators ==== ==== Decorators ====
   * https://realpython.com/primer-on-python-decorators/   * https://realpython.com/primer-on-python-decorators/
  
prog/python/language.1609433965.txt.gz · Zuletzt geändert: 2020/12/31 16:59 von admin