background preloader

Python

Facebook Twitter

Python Programmers sur Twitter : "Create projects using Raspberry Pi and Python #python #raspberrypi... Introduction to Raspberry Pi. This is an introductory course about the credit card sized computer Raspberry Pi.

Introduction to Raspberry Pi

This course is ideal for those who are interested in exploring the possibilities of Raspberry Pi as a computer. The course does not assume any prior knowledge on computers or programming. However, a knowledge of Linux operating system and Python programming language would greatly help you in getting up to speed. If you do not know Linux or Python, no need to worry. WebInDev.co sur Twitter : "The programming languages you should learn. Do you agree? #Python #Ruby #Java #PHP #Javascript #C...

Bjarneo/Spotipy. PageD'Accueil. CodesDivers. Extraire des adresses email Comment extraire les adresses email de n'importe quel fichier en 2 lignes de code !

CodesDivers

Il s'utilise de la façon suivante: python email_extractor.py < monfichier.html Recuperer une variable d'environnement Connaitre le chemin du répertoire dans lequel se trouve le script en cours Ceci peut s'avérer utile, par exemple pour importer d'autres modules se trouvant dans ledit répertoire... Attention: il semble que sous Windows XP, file contienne le chemin complet.

ExpressionsReguliere. Le module re (expressions régulières) est un moyen simple et rapide pour extraire des informations précises d'une chaine.

ExpressionsReguliere

Remarque : en bon français Regulars Expressions se traduit par Expressions Rationnelles import re re.compile(EXPRESSION, DRAPEAUX) Les drapeaux sont optionnelles match. UNIX Garden. Découverte : Tutoriel Python et GTK3. En consultant les flux RSS d’un des blogs auquel je suis abonné, j’ai fais une découverte intéressante qui aidera, j’en suis sur, plusieurs personnes qui codent en PyGTK.

Découverte : Tutoriel Python et GTK3

Nous assistons depuis pas mal de temps à beaucoup de changements au niveau programmation. Non seulement libglade est remplacé par GtkBuiler au niveau de la conception des interfaces graphiques faites par le formidable outil qu’est Glade3 mais nous avons aussi une évolution de Python qui passe de la version 2.7 à la version 3.2. Celle-ci casse la rétro compatibilité ascendante qui existait jusqu’à présent avec les version antérieurs cad qu’une application créer auparavant avec Python 2.5 fonctionnait avec Python 2.6 par exemple. Pour corser le tout, la fameuse bibliothèque graphique GTK passe aussi de la version 2 à la version 3. Avec ces évolutions majeures, ce ne sera plus le cas "out-of-box". Cependant tout n’est pas rose. Souvent dans le Libre, une ou des personnes s’ attachent à réparer ce manque. Débugger un script python. Si comme moi, vous utilisez un simple éditeur de texte du genre geany pour écrire vos scripts et programmes en python, il y a des chances que vous fassiez comme moi et que vous utilisiez l’instruction print pour débugger vos programmes.

Débugger un script python

Ca fonctionne très bien pour autant que le programme ne soit pas trop long et surtout que le bug ne soit pas trop vicieux. Il existe toujours la possibilité d’utiliser un IDE du genre Eric, pyCharm ou encore WingIDE mais les meilleurs ne sont pas gratuits et je ne ressens pas l’utilité d’utiliser de tels programmes. Langage Python. WxGlade: a GUI builder for wxWidgets/wxPython.

NOTE: This version of the tutorial is in sync with the current wxGlade on CVS, so some parts of it might not apply to the latest release. wxGlade Tutorial The aim of this minimal tutorial is to give an overview of wxGlade and its functionalities: despite its very short length, it is (hopefully) complete enough to make you understand how the application works, through a step-by-step description of the creation of a frame containing a notebook with some controls, a menubar and a statusbar.

wxGlade: a GUI builder for wxWidgets/wxPython

Before we start, let me apologize for my English: it's not my native language (I'm Italian), so it is very far from perfection. 1. Creation of the frame To create a new frame, click on the appropriate button of the "palette" ( WxGlade: a GUI builder for wxWidgets/wxPython. PythonInterface. Information on this page is deprecated, check the latest always-up-to-date documentation at .

PythonInterface

Starting with OpenCV release 2.2 , OpenCV will have completed it's new Python interface to cover all the C and C++ functions directly using numpy arrays. (The previous Python interface is described in SwigPythonInterface .) See notes on new developments at OpenCV Meeting Notes 2010-09-28 under "Vadim" subsection. Some highlights of the new bindings: Cookbook. Here is a collection of code fragments demonstrating some features of the OpenCV Python bindings.

Cookbook

Convert an image >>> import cv >>> im = cv . LoadImageM ( "building.jpg" ) >>> print type ( im ) <type 'cv.cvmat'> >>> cv . SaveImage ( "foo.png" , im ) Resize an image To resize an image in OpenCV, create a destination image of the appropriate size, then call Resize . >>> import cv >>> original = cv . Compute the Laplacian. Snyppets - Python snippets. Pt This page contains a bunch of miscellaneous Python code snippets, recipes, mini-guides, links, examples, tutorials and ideas, ranging from very (very) basic things to advanced.

Snyppets - Python snippets

I hope they will be usefull to you. All snippets are kept in a single HTML page so that you can easily ❶save it for offline reading (and keep on a USB key) ❷search in it. Note that scripts that do some web-scraping may not work anymore due to website changes. Using pyusb. Programming with PyUSB 1.0. Who's who First of all, let's give an overview on the PyUSB modules.

Programming with PyUSB 1.0

PyUSB modules are under the usb package. This package has the following modules: For example, to import the core module, you do as so: FAQ python. Introduction à Python. Fonction python. Enseignement Python en GTR. Python Tutorials, more than 300, updated March 2, 2009 and carefully sorted by topic and category. Gerer l'USB en python ou C/C++ (Page 1) / Développement et programmation. Python fr:Préface. You have seen how you can reuse code in your program by defining functions once. What if you wanted to reuse a number of functions in other programs that you write? As you might have guessed, the answer is modules. There are various methods of writing modules, but the simplest way is to create a file with a .py extension that contains functions and variables. Documentations, ressources et autres liens utiles. Python fr:Table des Matières. The Python Tutorial — Python v2.7.1 documentation.

Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Python’s elegant syntax and dynamic typing, together with its interpreted nature, make it an ideal language for scripting and rapid application development in many areas on most platforms. The Python interpreter and the extensive standard library are freely available in source or binary form for all major platforms from the Python Web site, and may be freely distributed. The same site also contains distributions of and pointers to many free third party Python modules, programs and tools, and additional documentation.

Python et l'agrégation d'outils. Utilisé autant dans le cadre de petits scripts répondant à des besoins immédiats, que pour des logiciels plus pérennes de toutes envergures, le langage Python excelle là où il faut interconnecter différentes technologies afin d'agréger des outils disparates utilisant des moyens de communication divers. Nous allons montrer ici l'utilisation de certaines techniques d'intégrations avec Python et donner des liens vers d'autres techniques et outils. C'est le b.a. -ba de la réutilisation de logiciels existant, être capable de démarrer un exécutable tiers, de lui fournir les données en entrée s'il y a lieu, et de récupérer les résultats en sortie s'il en produit.

On peut aussi vouloir un contrôle plus fin, avec une adaptation des entrées fournies au logiciel suivant des éléments extérieurs ou encore suivant les résultats qu'il produit. I-A. Listing 1. Sélectionnez. PHOTO SATELLITE AVEC ARCHIVAGE satellite, photos, archive, image, zip, Source N°52581 Python.

Cette source lorsqu'elle est lancée télécharge un fichier 'png' sur le site " cet image est mis à jour environ tout les quarts d'heure. Le script boucle sur lui même toute les 3 minutes. GÉNÉRATION D'UN LABYRINTHE AVEC RECHERCHE DU CHEMIN LE PLUS COURT AVEC ASTAR pathfinding astar, aetoile labyrinthe, generation labyrinthe, Source N°51293 Python. PRONOSTIQUES DE POKER PRÉ-FLOP poker, probabilités, listes, Source N°52151 Python.

Download Opencv Python Tutorial Source Codes, Opencv Python Tutorial Scripts - Python Tutorial by Python.orgaaaa, Python 101 (part 1): Snake Eyes by Python 101 (part 1): Snake Eyes and more... This is a very comprehensive 10 part Python tutorial that introduces the reader informally to the basic concepts and features of the Python language and system. It helps to have a Python interpreter handy for hands-on experience, but all examples are self-contained, so the tutorial can be read off-line as well. Effort to translate Python documentation in Bulgarian (starting with Python Tutorial). A couple snippets grabbed from other sources and put together here.Demonstrates: Conversion to greyscale: cv.CvtColor, Sobel operator: cv.Sobel, Smoothing: cv.Smooth This is a simple code that lets a user control the mouse and left-click using the Microsoft Kinect, Python, and OpenKinect.

PRENEUR DE CHOIX, PRISE DE DECISION, COMPARAISON D ELEMENT decision, choix, ia, Source N°52410 Python.