This file contains hidden or 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
# Add question files from a provider like Aeroclub (https://aeroclub.at/de/behoerde/download) | |
import os | |
from PyPDF2 import PdfReader | |
import re | |
import json | |
# Make sure the spl-ecqb-ppl files are placed in /sourcefiles directory. | |
os.makedirs("images", exist_ok=True) |
This file contains hidden or 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
# Credits to Stackoverflow user u1234x1234 | |
# Source: https://stackoverflow.com/questions/73666119/open-cv-python-quantize-to-a-given-color-palette | |
# The example was changed to automatically pick up the primary colors | |
import cv2 | |
import numpy as np | |
image_path = 'input.png' | |
image_output_path = 'output.png' | |
quantize_count = 16 # How many colors will be left |
This file contains hidden or 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 requests | |
import matplotlib.pyplot as plt | |
import datetime | |
latitude = 48.3 | |
longitude = 13.3 | |
# Get data from api.open-meteo.com | |
response = requests.get('https://api.open-meteo.com/v1/forecast' | |
'?latitude=' + str(latitude) + '&longitude=' + str(longitude) + '&' |
This file contains hidden or 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 requests | |
from fritzconnection import FritzConnection | |
import xml.etree.ElementTree as Et | |
CALL_LOG = 5 | |
# Definition of call's type value: | |
# src: https://avm.de/fileadmin/user_upload/Global/Service/Schnittstellen/x_contactSCPD.pdf | |
# 1 incoming Call answered by phone or answering machine. | |
# 2 missed Incoming call was not answered by internal phone or answering machine. |