background preloader

Python

Facebook Twitter

Pythonidae/README.md at master · svaksha/pythonidae. How We Deploy Python Code. Building, packaging, and deploying Python using versioned artifacts in Debian packages By: Rob McQueen We love Python at Nylas.

How We Deploy Python Code

The syntax is simple and expressive, there are tons of open source modules and frameworks available, and the community is welcoming and diverse. Our backend is written exclusively in Python, and our team frequently gives talks at PyCon and meetups. Les secrets d'un code pythonique. Welcome to Python cheatsheet! — pysheeet. Asynchronous Python. Green Threads Green threads are a primitive level of asynchronous programming.

Asynchronous Python

A green thread looks and feels exactly like a normal thread, except that the threads are scheduled by application code rather than by hardware. Gevent is a well known python library for using green threads. Gevent is basically green threads + eventlet, a non-blocking I/O networking library. Gevent monkey patches common python libraries to have non-blocking I/O. As you can see, the gevent API looks and feels just like threading.

How to Configure NGINX for a Flask Web Application – Patrick's Software Blog. Introduction In this blog post, I’ll be explaining what NGINX is and how to configure it for serving a Flask web application.

How to Configure NGINX for a Flask Web Application – Patrick's Software Blog

This blog post is part of a larger series on deploying Flask applications. I’ve found a lot of documentation about NGINX and how to configure it, but I wanted to dive into the details for how NGINX can be used in a Flask web application and how to configure it. I’ve found the configuration of NGINX to be a bit confusing, as a lot of the documentation simply shows a configuration file(s) without explaining the details of what each step does. La reconnaissance musicale en Python. Python 201: An Intro to itertools. Python provides a great module for creating your own iterators.

Python 201: An Intro to itertools

The module I am referring to is **itertools**. The tools provided by itertools are fast and memory efficient. You will be able to take these building blocks to create your own specialized iterators that can be used for efficient looping. In this chapter, we will be looking at examples of each building block so that by the end you will understand how to use them for your own code bases. Let’s get started by looking at some infinite iterators! The infinite iterators The itertools package comes with three iterators that can iterate infinitely. Apprendre l'optimisation du code avec Python. Maintenant que nous avons identifié les goulots d'étranglement, nous devons accélérer leurs codes.

Apprendre l'optimisation du code avec Python

Le premier objectif à atteindre est l'optimisation de votre algorithme : existe-t-il des moyens de calculer moins, ou plus rapidement ? Une bonne compréhension des mathématiques liées aux algorithmes permet d'avoir une bonne vue d'ensemble du problème. Cependant, il n'est pas rare de trouver des modifications simples, comme sortir d'une boucle FOR des calculs ou une allocation mémoire, ce qui permet d'obtenir des gains significatifs.

Pymunk 5.0.0 documentation. Pymunk is a easy-to-use pythonic 2d physics library that can be used whenever you need 2d rigid body physics from Python.

pymunk 5.0.0 documentation

Perfect when you need 2d physics in your game, demo or other application! It is built on top of the very capable 2d physics library Chipmunk. The first version was released in 2007 and is still actively developed and maintained today. Getting Started To get started quickly take a look in the Readme, it contains a summary of the most important things and is quick to read. Apprendre comment Hired fonctionne ici ! - Hired. Penser ‘Thread’ pour simplifier vos programmes. Dans les exemples du premier article de La Saga Blink, l’auteur mettait en avant l’intérêt de pouvoir se sortir de la boucle de clignotement d’une LED en proposant une ‘combine’ non bloquante de contrôle des caractères.

Penser ‘Thread’ pour simplifier vos programmes

Une solution qui peut paraître satisfaisante, mais l’est-elle réellement ? … Bien que parfaitement fonctionnels, de nombreux exemples proposés souffrent d’une même anomalie que l’on ne peut ignorer du fait qu’elle remet en cause l’usage même de ces exemples dans d’autres programmes. Voyons donc pourquoi et comment faire autrement. The Hitchhiker’s Guide to Python! Python-for-android 0.4 released, now available on PyPI. We’ve just officially released python-for-android 0.4, and pushed it to PyPI for the first time!

python-for-android 0.4 released, now available on PyPI

Python-for-android is a packaging tool for turning Python scripts and apps into Android APKs. It was originally created for use with the Kivy graphical framework, but now supports multiple kinds of Python app including Kivy, PySDL2, a webview interface with Flask or other webserver backend, plain Python scripts without a GUI, or other possibilities such as Python builds for use in other applications. This release is the culmination of all the work over the last year to replace Kivy’s old Android toolchain with something more flexible and useful for other projects.

Major features added in this time include the fully Python toolchain itself, support for SDL2 and other bootstraps, (experimental) python3 support via the CrystaX NDK, multiple architecture support, and many general improvements to the backend. Scientific python cheat sheet by IPGP. Pure Python Types a = 2 # integer b = 5.0 # float c = 8.3e5 # exponential d = 1.5 + 0.5j # complex e = 4 > 5 # boolean f = 'word' # string.

Scientific python cheat sheet by IPGP

Kozea/wdb: An improbable web debugger through WebSockets. Turning the Raspberry Pi into a SMS Center using Python – My Blog. As I described already in another article – Running the Raspberry Pi on Solar Power it is pretty easy to run the Raspberry Pi on solar energy.

Turning the Raspberry Pi into a SMS Center using Python – My Blog

This fact combined with the small form factor of the Pi makes it extremely portable platform. In one of my projects I will leave the Raspberry Pi working in a distant rural area with no wired or wifi connection. The only possibility to connect to it is through the cell phone network. So I came up with the idea to control the Pi with short messages or SMSs.

In order to connect the Pi with the cell network we would first need a 3g modem. Python et les décorateurs — Gilles Fabio. 30 Python Language Features and Tricks You May Not Know About. 1 Introduction Since I started learning Python, I decided to maintain an often visited list of "tricks". Any time I saw a piece of code (in an example, on Stack Overflow, in open source software, etc.) that made me think "Cool! I didn't know you could do that! " I experimented with it until I understood it and then added it to the list. This post is part of that list, after some cleaning up. Flask At Scale. Noamraph/tqdm: Add a progress meter to your loops in a second. Welcome to robobrowser’s documentation! — robobrowser 0.1 documentation.

Learn

The Arcade Python Package — Arcade 0.0.6r44 documentation. Copyright (c) 2016 Paul Vincent Craven The Arcade library is licensed under the MIT License. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

Regex101 - L'outil ultime pour trouver, créer, tester et comprendre des regex. Si vous aimez vous prendre la tête avec des Regex, voici un site qui devrait vous plaire. Baptisé Regex101, il permet de tester ses expressions régulières ou de les construire à l'aide d'un mémento bien pratique. Mais ce que je préfère sur Regex101, c'est l'encadré "Explication" qui détaille en langage clair (et en anglais), ce que fait exactement cette expression régulière.

Par exemple, si j'indique cette regex qui permet de trouver une URL dans un texte HTML... Nuitka (python compiler) Overview This document is the recommended first read if you are interested in using Nuitka, understand its use cases, check what you can expect, license, requirements, credits, etc. Nuitka is the Python compiler. It is a seamless replacement or extension to the Python interpreter and compiles every construct that CPython 2.6, 2.7, 3.2, 3.3, 3.4, and 3.5 have.

It then executed uncompiled code, and compiled code together in an extremely compatible manner. How to Deploy Python WSGI Apps Using Gunicorn HTTP Server Behind Nginx. Introduction Perhaps it was the article on Python Web Server Comparison tempting you to switch, or the the fact that you have simply outgrown your current application deployment stack.

You are interested in finding out more about Gunicorn Web Server and want to learn how to deploy a Python application thoroughly from the start. In this DigitalOcean article, our aim is to help you with all the above and then some. Mlxtend.

Machine Learning

Awesome Python. .mobo — Servir une application web python avec chaussette, circus et nginx.