Listing 1: folder_example_fun.py

from os import listdir, remove

def delete_files(folder, extension='.tmp'):
  for file in listdir(folder):
    print(file)
    if file.endswith(extension):
        remove(folder + file)
        print(f'{file} gelöscht')

Listing 2: object_example.py

import numpy as np
from matplotlib import pyplot as plot
import pandas as pd

import matplotlib.cm as cm

class TeamPlot:
  def __init__(self, team, punkte):
    self.d = pd.DataFrame({'Team' : x,
                           'Punkte' : y}, index=range(1,len(team)+1))
  
  def print(self):
    print(self.d)
  
  def plot(self):
    plot.title("Statistik")
    plot.barh(self.d.Team, self.d.Punkte)
    plot.show()


class TeamPlotExt(TeamPlot):
  def __init__(self, team, punkte):
    super().__init__(team,punkte)
    self.map = cm.get_cmap('jet')

  def plot(self):
      plot.title("Statistik")
      plot.barh(self.d.Team, self.d.Punkte, color=self.map(self.d.Punkte))
      plot.show()

class TeamPlot:
  def __init__(self, team, punkte):
    self.d = pd.DataFrame({'Team' : x, …

Listing 3: flask_example.py

from flask import Flask

app = Flask(__name__)

@app.route('/')
def hallo():
    return 'hallo'

@app.route('/<name>')
def hallo_name(name):
    return 'hallo ' + name

if __name__ == '__main__':
    app.run()

Listing 4: folder_example_typed.py

from os import listdir, remove

folder: str = 'c:/example_path/'


def delete_files(folder: str, extension: str = '.tmp') -> None:
    file: str
    for file in listdir(folder):
        print(file)
        if file.endswith(extension):
            remove(folder + file)
            print(f'{file} gelöscht')
