background preloader

Plongez au coeur de Python

Plongez au coeur de Python

How not to write Python code » Ikke’s blog Lately I’ve been reading some rather unclean Python code. Maybe this is mainly because the author(s) of the code had no in-depth knowledge of the Python language itself, the ‘platform’ delivered with cPython,… Here’s a list of some of the mistakes you should really try to avoid when writing Python code: Some days ago RealNitro pointed me at this list of essential Python readings. “Idiomatic Python” is a must-read, even for experienced Python developers. That’s about it for now, maybe I’ll add some more items to this list later on. Posted in Development, Technology. Tagged with Development, python. By Nicolas – February 8, 2008

L’opérateur splat (l’étoile: *) en Python L’utilisation du signe étoile (*, dit opérateur « splat ») en Python est très simple, mais certains cas sont peu intuitifs. Les nouveaux venus ont souvent besoin d’un peu plus d’explications que ce que donne la doc. Les utilisateurs d’autres langages sont généralement déroutés, car ils sont habitués à certaines fonctionnalités qu’on ne retrouve pas en Python. Ce que * ne permet pas de faire Il n’y a pas de pointeur en Python, et les passages par référence sont automatiques. N’existe pas en Python. Les usages basiques de * La multiplication et la puissance fonctionnent comme on l’attend : Mais déjà, Python se démarque du lot, car l’opérateur * est surchargé par défaut, et peut s’appliquer aux chaines de caractères et aux listes. Pour les listes, c’est plus subtil. En revanche, multiplier une liste d’objets modifiables ne fait que répéter la référence vers cet objet : On a l’impression que le comportement est le même que précédemment, en fait pas du tout. Unpacking Quel rapport avec * ?

Graphviz PyCON FR Google Python Style Guide No whitespace inside parentheses, brackets or braces. No whitespace before a comma, semicolon, or colon. Do use whitespace after a comma, semicolon, or colon except at the end of the line. Yes: if x == 4: print x, y x, y = y, x No: if x == 4 : print x , y x , y = y , x No whitespace before the open paren/bracket that starts an argument list, indexing or slicing. Yes: dict['key'] = list[index] No: dict ['key'] = list [index] Surround binary operators with a single space on either side for assignment (=), comparisons (==, <, >, ! Don't use spaces around the '=' sign when used to indicate a keyword argument or a default parameter value. Yes: def complex(real, imag=0.0): return magic(r=real, i=imag) No: def complex(real, imag = 0.0): return magic(r = real, i = imag) Don't use spaces to vertically align tokens on consecutive lines, since it becomes a maintenance burden (applies to :, #, =, etc

Les romans audio et pdf d' Honoré de Balzac Nous ne détaillerons pas ici la biographie de l'écrivain, celle ci est suffisamment décrite dans une multitude d'articles ou de revues, Balzac est avant tout, le précurseur de la littérature moderne. Tout comme Emile Zola, qui fit l'étude, par l'intermédiaire d'une vingtaine de romans, de l'influence sous le second empire, des tares génétiques au travers de la saga d'une famille " Les Rougon-Macquart". Balzac est un personnage à géométrie variable et il est très intéressant de cerner sa personnalité et son caractère dans les quelques pages qui suivent. C'est au travers d'un projet littéraire et d'une immense fresque qui dépeint la société du dix neuvième siècle, qu' "En 1845, honoré de Balzac décida de réunir toute son oeuvre sous le titre: La Comédie Humaine, titre qu'il emprunta peut-être à Dante ou à Vigny... * Etudes de moeurs 1. 2. 3. 6. 8.

Essential Python Reading List Here’s my essential Python reading list. I’ve tried to order the items so you can pause or stop reading at any point: at every stage you’ll have learned about as much possible about Python for the effort you’ve put in. The Zen of Python The Zen of Python is so short I can include it here in its entirety. Typing import this in an interpreted session gives a pythonic spin on “Hello, world”. >>> import this The Zen of Python, by Tim Peters Beautiful is better than ugly. If this doesn’t ring true, Python isn’t for you. Python Tutorial Your next stop should be the Python tutorial. start here The latest version (by which I mean the version corresponding to the most recent stable release of Python) can be found on the web at but I recommend you find and bookmark the same page from your local Python installation: it will be available offline, pages will load fractionally quicker, and you’re sure to be reading about the version of Python you’re actually running. What’s New?

<stdin> | Bazar / Django on OVH Comment installer un site Django sur un serveur OVH. Disclaimer Si vous cherchez un hébergeur, tournez vous plutôt vers Gandi ou l'association toile libre. OVH c'est en effet illustré à plusieurs reprises par sa politique répressive et injuste envers ses clients suspectés d'enfreindre la législation sur le droit d'auteur. Voir notamment l'article de Numerama. Intro Basé sur Mettre à jour le $PYTHONPATH. Architecture des fichiers cgi-bin/ django.cgi [django-project]/ [applications]/ static/ templates/ settings.py … lib/ python/ django/ (autres librairies nécessaires) elementtree/ (pour markdown) markdown/ www/ .htaccess staticmedia Les fichiers en italique sont des liens symboliques. django.cgi L'original peut être téléchargé ici: Remplacer les chemins et les noms de projet en fonction. Pour voir le déboguage Django, remplacer la dernière ligne par: .htaccess

Livre Audio Français 3 | Mohamed Ali Yousfi محمد علي اليوسفي Cliquez ici pour écouter un extrait Voltaire-Jusqu’à quel point on doit tromper le peuple Cliquez ici pour écouter un extrait Cliquez ici pour écouter un extrait Cliquez ici pour écouter un extrait Livres audio gratuits-genre ‘Fantastique’ GAUTIER, Théophile – La Pipe d’Opium Durée : 20min > Télécharger le mp3 (Clic-droit, “Enregistrer sous…”) FLAUBERT, Gustave – Rêve d’enfer Durée : 1h 30min Rêve d’enfer.zip GOGOL, Nicolas – Le Nez Durée : 1h 11min > Télécharger le mp3 (Clic-droit, “Enregistrer sous…”) POE, Edgar Allan – Manuscrit Trouvé Dans Une Bouteille Durée : 30min > Télécharger le mp3 (Clic-droit, “Enregistrer sous…”) HOFFMANN, E. Durée : 2h 10min > Écouter un extrait : Chapitre 1 STEVENSON, Robert Louis – L’Étrange cas du Dr. Durée : 3h 30min > Écouter un extrait : Chapitre 1 BALZAC, Honoré (de) – L’Élixir de longue vie Durée : 1h 5min Première partie > Télécharger le mp3 (Clic-droit, “Enregistrer sous…”) Seconde partie > Télécharger le mp3 (Clic-droit, “Enregistrer sous…”) Durée : 1h 14min Durée : 22min

Distutils-SIG Charter The Distutils-SIG exists to discuss the design, implementation, and maintenance of a suite of module distribution utilities for Python. These utilities are grouped in the 'distutils' package in Python. The goal of distutils is to make building, packaging, distributing, and installing Python modules, extensions, and applications painless and standardized. There are also third-party tools built on the top of distutils, that are using the Distutils mailing list as their home. Namely: setuptools zc.buildout If you are packaging a Python package, this SIG is probably a good starting point to ask questions. The goal of Distutils-SIG is also to try to catch the good bits and practices from third-party projects and insert them in Distutils itself to serve the community. What's Available Interested in learning more or trying out the Distutils?

Related: