Benutzer-Werkzeuge

Webseiten-Werkzeuge


prog:python:language

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Nächste Überarbeitung
Vorhergehende Überarbeitung
prog:python:language [2019/10/27 08:36] – angelegt 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 6: Zeile 11:
   * http://stackoverflow.com/questions/12632602/class-method-with-no-arguments-produces-typeerror   * http://stackoverflow.com/questions/12632602/class-method-with-no-arguments-produces-typeerror
   * http://stackoverflow.com/questions/31907122/extend-an-instance-at-runtime   * http://stackoverflow.com/questions/31907122/extend-an-instance-at-runtime
 +  * [[https://stackoverflow.com/questions/43807642/why-the-need-for-thread-init-in-a-class|Subclassing erfordert den Aufruf des Konstruktors der SuperClass]]
  
   * http://masnun.rocks/2017/04/15/interfaces-in-python-protocols-and-abcs/   * http://masnun.rocks/2017/04/15/interfaces-in-python-protocols-and-abcs/
Zeile 29: Zeile 35:
   * [[http://stackoverflow.com/questions/30362391/how-to-find-first-key-in-a-dictionary|find-first-key-in-a-dictionary]]   * [[http://stackoverflow.com/questions/30362391/how-to-find-first-key-in-a-dictionary|find-first-key-in-a-dictionary]]
   * [[http://stackoverflow.com/questions/40923429/delete-first-item-in-each-key-in-a-dictionary|delete-first-item-in-each-key-in-a-dictionary]]   * [[http://stackoverflow.com/questions/40923429/delete-first-item-in-each-key-in-a-dictionary|delete-first-item-in-each-key-in-a-dictionary]]
 +  * [[https://codereview.stackexchange.com/questions/85842/a-dictionary-that-allows-multiple-keys-for-one-value/103966|A dictionary that allows multiple keys for one value]]
 +
 +==== 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:
 +
 +<code python list.py>
 +l = [None]*10 # Leere Liste mit 10 Elementen
 +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>
 +
  
 ==== Threads ==== ==== Threads ====
   * [[https://stackoverflow.com/questions/11334447/monitor-thread-synchronization-in-python|Monitor thread synchronization]]   * [[https://stackoverflow.com/questions/11334447/monitor-thread-synchronization-in-python|Monitor thread synchronization]]
-  * http://www.tutorialspoint.com/python/python_multithreading.htm+  * [[https://realpython.com/intro-to-python-threading/|An Intro to Threading in Python]] 
 +  * https://docs.python.org/3/library/threading.html 
 +  * https://hackernoon.com/synchronization-primitives-in-python-564f89fee732 Let’s Synchronize Threads in Python 
 + 
 +==Beispiele== 
 +  * [[https://www.bogotobogo.com/python/Multithread/python_multithreading_creating_threads.php|Multithreading - Creating Threads]] 
 +  * [[https://www.bogotobogo.com/python/Multithread/python_multithreading_subclassing_creating_threads.php|Subclassing Thread]] 
 +  * [[https://dzone.com/articles/python-thread-part-1|Python Thread Tutorial (Part 1)]] 
 +  * [[https://dzone.com/articles/python-thread-part-2|Python Thread Tutorial (Part 2)]] 
 +  * https://www.geeksforgeeks.org/start-and-stop-a-thread-in-python/ 
 +  * https://code-maven.com/slides/python/python-threads 
 +  * [[https://stackoverflow.com/questions/919897/how-to-obtain-a-thread-id-in-python|How to obtain a Thread id in Python?]] 
 + 
 +== Synchronisation == 
 + 
 +  * [[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://pymotw.com/2/Queue/|Queue – A thread-safe FIFO implementation]] 
 + 
 +==== Decorators ==== 
 +  * https://realpython.com/primer-on-python-decorators/ 
prog/python/language.1572165405.txt.gz · Zuletzt geändert: 2019/10/27 08:36 von admin