Skip to content

Instantly share code, notes, and snippets.

View hheimbuerger's full-sized avatar
👨‍👧‍👦
Parenting

Henrik Heimbuerger hheimbuerger

👨‍👧‍👦
Parenting
View GitHub Profile
import csv
with open('input.csv', 'rb') as input, open('output.csv', 'wb') as output:
reader = csv.reader(input, delimiter=';')
writer = csv.writer(output, delimiter=';')
for input_row in reader:
firstname, name, accno, bsc, amount = input_row
output_row = [name, '%s %s' % (firstname, name), accno, bsc, amount]
writer.writerow(output_row)
@hheimbuerger
hheimbuerger / settings.py
Last active August 29, 2015 14:04
define AppConfig for kombu in settings.py
from django.apps import AppConfig
class KombuApp(AppConfig):
name = 'kombu.transport.django'
label = 'django_kombu'
INSTALLED_APPS = (
'myproj.settings.KombuApp',
)
@hheimbuerger
hheimbuerger / flask_concurrent_blocking_initialization_example.py
Last active April 19, 2023 22:31
Flask app with long-running startup code, that blocks incoming requests until initialization is complete
import concurrent.futures
from functools import wraps
from flask import Flask
data = None
def long_running_initialization():
# Long running initialization code goes here