Python : hints & cheats

Son propre fichier basique de log

import datetime
msg = "Test de log"
dt =
with open("monlogfile.log", 'a+') as f:
    f.write('{:02}:{:02} - {}\n'.format(
        dt.hour, dt.minute, msg))

Teaching Python


Découpages Python : formation


Demystifying Two Factor Auth

Two-factor auth

Python Open Source Projects of the Year


Thanks to Dan Bader

Learning Python in minutes

How to Send an Email With Python

The Python range() Function

Python sleep(): How to Add Time Delays to Your Code

Cool New Features in Python 3.8

Python Decorators From the Ground Up

How — and why — you should use Python Generators

Download information on all your gmail emails and the body text to either csv or json. I developed this to download my 100K + emails stored over several years on gmail.

Memoization in Python: How to Cache Function Results

Implementing a Neural Network from Scratch in Python – An Introduction


Mailtrap – Sending Emails


Introduction to NumPy and Pandas – A Simple Tutorial

Fastest way to uniquify a list in Python >=3.6

8 Python Modules For Files Handling

How do async for loops work in Python? Using asynchronous for loops in Python

How to use Python and Flask to build a web app — an in-depth tutorial

Framework ultra simple pour faire des micro-services en Json
Falcon is a bare-metal Python web API framework for building very fast app backends and microservices.

How to break a CAPTCHA system in 15 minutes with Machine Learning

Python Exceptions: An Introduction

Python Metaclasses

Building a Simple Web App with Bottle, SQLAlchemy, and the Twitter API

Python – Regular Expressions Practical Guide

A fast high-level screen scraping and web crawling framework.

A fast high-level screen scraping and web crawling framework.

Python Web scraping

Tips for writing extremely short Python programs
Extremely short Python programs (aka « golfing »)

Instagramming with Python for Data Analysis
The guide

Julien Danjou blog

Easy Python logging with daiquiri

The three things you need to know about packaging are:

  • – Use pip to install your packages from PyPI
  • – Use pbr to package your modules
  • – Use PyPI to publish your package

Read more here.

A safe GitHub workflow with Pastamaker
The definitive guide to Python exceptions
How do you write your Python tests?
The unittest module in Python is the natural entry point to start writing test, and it’s really easy to use. It’s not really harder than using assert, and it will provide much nicer output when run. Once you get on that road, there’s a lot of other nice modules you can start using, such pytest, coverage, nose or mock. And if your project is hosted on places such as GitHub, it’s really easy to use services such as Travis to automate tests runs.

A simple filtering syntax tree in Python

Stop merging your pull requests manually

How I stopped merging broken code

How to Log Properly in Python

More GitHub workflow automation

Code Style Checks in Python