background preloader

Plongez au coeur de Python

Plongez au coeur de Python

Karrigell/Home page Home page[edit] For the moment we'll ignore the CDs and begin writing the home page Create a new folder mycds in your Karrigell distribution, under the www folder. With your favorite text editor, save this text in a file called index.ks def index(): print "<h1>My CD collection</h1>" In your browser ask localhost/mycds/index.ks/index The extension "ks" (Karrigell Service) means that the script is a Python script where functions match urls : here, index.ks/index means that the function index() will send the data back to the browser In fact if you don't specify a function name, the index() function in the script will be run, so you could have asked localhost/mycds/index.ksand if you don't even specify a script name in a folder, the script called index will be run. Notice the print statement in the index() function. Adding a page counter[edit] The page counter will print the number of times that the page has been seen. A better page counter[edit] Use the built-in Session() function Summary[edit]

Ressources Python Ressources didactiques Gérard Swinnen Vous trouverez ci-dessous : en téléchargement libre, les versions numériques de l'ouvrage "Apprendre à programmer avec Python" de Gérard Swinnen (troisième et cinquième éditions), anciennement publié aux éditions O'Reilly et dorénavant édité chez Eyrolles (ISBN 978-2-212-13434-6) ; le code source des exemples et exercices proposés dans le livre ;Les diapositives et le code source des exemples présentés par G.Swinnen au colloque "Libr'East of Paris" (IUT de Marne-la-vallée) les 23 & 24 Avril 2004 ;Les diapositives de la conférence sur Python présentée à l'IUT de Vannes (Université de Bretagne Sud), le 15 Avril 2005 ;La traduction du livre en hongrois (+ lien vers le site web du traducteur).La traduction du livre en arabe (+ lien vers le site web des traducteurs). Les deux dernières éditions traitent de la version 3 de Python. Au sommaire : Préface. *** Traduction hongroise *** Merci infiniment, Péter ! *** Traduction arabe *** ... Téléchargements

20 Useful Free PDF ebooks for Designers and Bloggers :Speckyboy Design Magazine Over the years I have a saved a decent sized library of useful design and blogging related PDF ebooks, I love them. I have voraciously collected them, and all stored on my mobile for whenever the chance of quick read arises. In this post I would like to share my favorite 20 (freely available) ebooks with you. All of the below books are have been written to be read quickly, they are neither very long nor are they the definitive resource on their specific subject. Introduction to Good Usability by Peter Pixel This guide is especially handy if you haven’t done a lot of webdesign yet or if you are involved in webdesign but don’t do any of the real work. A lot of books have been written in the past but the threshold for reading them, especially if you have never built a site, is quite big, hence this short guide. Introduction to Good Usability →Download the PDF → Web Accessibility Checklist by Aaron Cannon Web Accessibility Checklist →Download the PDF → Better CSS Font Stacks by Nathan Ford

19.13. xml.etree.ElementTree — The ElementTree XML API — Python v2.7.2 documentation The Element type is a flexible container object, designed to store hierarchical data structures in memory. The type can be described as a cross between a list and a dictionary. To create an element instance, use the Element constructor or the SubElement() factory function. The ElementTree class can be used to wrap an element structure, and convert it from and to XML. A C implementation of this API is available as xml.etree.cElementTree. See for tutorials and links to other docs. 19.7.1. This is a short tutorial for using xml.etree.ElementTree (ET in short). 19.7.1.1. XML is an inherently hierarchical data format, and the most natural way to represent it is with a tree. 19.7.1.2. We’ll be using the following XML document as the sample data for this section: <? We have a number of ways to import the data. import xml.etree.ElementTree as ETtree = ET.parse('country_data.xml')root = tree.getroot() Reading the data from a string: >>> root[0][1].text'2008' <? <?

A byte of Python - Table des Matières Share Book Recommendations With Your Friends, Join Book Clubs, Answer ... Apprendre à programmer avec Python Un livre de Wikilivres. Ce livre a été rédigé par Gérard Swinnen qui le met à disposition sur son site personnel [archive] en licence GFDL. À faire... formater tous les chapitres selon le livre imprimé importer les captures d'écran [1] demander à l'auteur la licence des schémas intégrer les exercices éradiquer les {{todo}}lier les pages ( Non : attendre la spécification et l'implémentation de css3)établir l'indexétablir un glossaire Sommaire[modifier | modifier le wikitexte] Voir aussi[modifier | modifier le wikitexte] Programmation Python

Pygame Un livre de Wikilivres. Avant propos[modifier | modifier le wikicode] Ce livre est un wiki et peut par conséquent être amélioré par tout le monde. N'hésitez pas à participer ! 1) Ceci est la traduction de la documentation de pygame présente sur le site [archive] . 2) Cette traduction est approximative et parfois trop mot à mot, si une tournure vous gêne, vous pouvez la corriger ou en parler sur la page de discussion. 3) Ce n'est pas une traduction de la documentation de référence de Pygame, celle-ci étant disponible à l'adresse [1] . Sommaire[modifier | modifier le wikicode] Introduction à Pygame Une introduction aux bases de Pygame. Importation et initialisation Premiers pas sur l'importation et l'initialisation de Pygame. Déplacer une image Un tutoriel de bases couvrant les concepts derrière l'animation 2D par ordinateur. Chimp - Ligne par ligne Les exemples de Pygame incluent un petit programme avec un poing interactif et un singe. Introduction au module Sprite

Libfly, la bibliothèque communautaire ... The Official web2py Book I believe that the ability to easily build high quality web applications is of critical importance for the growth of a free and open society. This prevents the biggest players from monopolizing the flow of information. Hence I started the web2py project in 2007, primarily as a teaching tool with the goal of making web development easier, faster, and more secure. Over time, it has managed to win the affection of thousands of knowledgeable users and hundreds of developers. Our collective effort has created one of the most full-featured Open Source Web Frameworks for enterprise web development. As a result, in 2011, web2py won the Bossie Award for best Open Source Development Software, and in 2012 it won the Technology of the Year award from InfoWorld. As you will learn in the following pages, web2py tries to lower the barrier of entry to web development by focusing on three main goals: Ease of use. Rapid development. Security.

Related: