- 622 Seiten, 32,90 €, dpunkt.verlag, ISBN: 978-3-86490-444-8,
- https://www.dpunkt.de/buecher/12869/9783864904448-python-crashkurs.html
This file contains 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
import urllib.request | |
import datetime | |
def download(url): | |
""" | |
Download and return data from the given URL. | |
""" | |
data = urllib.request.urlopen(url).read() | |
return data |
This file contains 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
from abc import ABC, abstractmethod | |
# abc = abstract base class | |
# Klassen, die von ABC erben, sind selbst abstrakt | |
class BaseGate(ABC): | |
# Deklaration einer abstrakten Methode | |
@abstractmethod | |
def perform(self) -> bool: | |
... |
This file contains 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
import time | |
WAIT_TIME = 0.001 # seconds | |
MAX = 10 | |
def do_something_time_comsuming(): | |
time.sleep(WAIT_TIME) | |
def linear(n): |
This file contains 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
import math | |
import time | |
import random | |
import levels | |
try: | |
import rogueflip | |
import pygame | |
except ImportError as e: | |
print("Unable to import pygame or rogueflip. \ | |
Some games may not be runnable!", e) |
This file contains 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
/* Magic Mirror Config Sample | |
* | |
* By Michael Teeuw http://michaelteeuw.nl | |
* MIT Licensed. | |
* | |
* For more information how you can configurate this file | |
* See https://github.com/MichMich/MagicMirror#configuration | |
* | |
*/ |