background preloader

Python codeline

Facebook Twitter

Python graphics

QR code. Python ressources. Python Exercices. OpenCL en Python. PyOpenCL est une interface entre Python et C OpenCL.

OpenCL en Python

Vous pouvez créer une maquette d'application en Python avec du code en C OpenCL. Lorsque que vous voudrez réécrire votre application en C/C++ ou Java, le code C OpenCL devra simplement être copié/collé. Ce qui fait de Python la meilleure façon de se lancer dans OpenCL. Je décris ici la méthode d'installation de PyOpenCL dans avec les driver NVidia. Un très bon article sur l'installation de PyOpenCL avec ATI Stream existe déjà : Installation de PyOpenCL : sous Linux Je décris ici l'installation de PyOpenCL sous Ubuntu 9.10 (64bits).

Python tutorials

Python Tutorials, more than 300, updated March 2, 2009 and carefully sorted by topic and category. Django. Tutorial - Learn Python in 10 minutes. NOTE: If you would like some Python development done, my company, Stochastic Technologies, is available for consulting.

Tutorial - Learn Python in 10 minutes

This tutorial is available as a short ebook. The e-book features extra content from follow-up posts on various Python best practices, all in a convenient, self-contained format. All future updates are free for people who purchase it. Preliminary fluff So, you want to learn the Python programming language but can't find a concise and yet full-featured tutorial. Properties. Table des matières. ★ Cours pour apprendre Python.

Python recurent subjects

Learn Python in 10 minutes. Scraping with JQuery or Python. Python + Jquery: Open Browser and POST data. Live Search Ajax with JQuery & Python. Web Dynamism w/Python+jQuery - Part 1. This is part 1 of a 3 part series.

Web Dynamism w/Python+jQuery - Part 1

Check out part 2 and part 3. Having a static, standards compliant, flat-file website isn't a bad thing. But sometimes it's nice to inject a little bit of life into a page or two. Not only can it help keep things interesting but it might substantially increase usability as well. Prerequisites A webserver which allows you to execute CGI scripts (we'll use Python CGI, to be exact, although you could potentially use any language you're familiar with).Access to an SMTP server for actually sending the email out (this can likely be done with your regular email account).The jQuery JavaScript library.A Python interpreter.

If you're running your own server then you'll likely need to do some configuration (generally it comes down to adding a line like AddHandler cgi-script .py to your Apache httpd.conf file, for other webservers and platforms, ask Google). So let's invent an example and see what happens. The Example Let's start by writing the form. The Form The Demo.

Python memory utilities

Gestion de la memoire avec python. Advanced Python or Understanding Python. Google I/O 2008 - Painless Python Part 2 of 2. Python web. Python application. Example - python-graph - python-graph usage example. - A library for working with graphs in Python. 2D and 3D Graphics in Python. PyX - Python graphics package. Google Python Class Day 1 Part 3. Game Programming Tutorial 1 in Python: Introduction. Application web en python. Beautiful Soup documentation. By Leonard Richardson (leonardr@segfault.org) 这份文档也有中文版了 (This document is also available in Chinese translation) Этот документ также доступен в русском переводе.

Beautiful Soup documentation

[Внешняя ссылка] (This document is also available in Russian translation. [External link]) Beautiful Soup 3 has been replaced by Beautiful Soup 4. Lxml - Processing XML and HTML with Python. Lxml: an underappreciated web scraping library. When people think about web scraping in Python, they usually think BeautifulSoup . That’s okay, but I would encourage you to also consider lxml . First, people think BeautifulSoup is better at parsing broken HTML. Lxml parses broken HTML quite nicely. I haven’t done any thorough testing, but at least the BeautifulSoup broken HTML example is parsed better by lxml (which knows that <td> elements should go inside <table> elements).

Second, people feel lxml is harder to install. Web scraping with Python for fun and profit. Web is everywhere, we know.

Web scraping with Python for fun and profit

It is also used more and more to present information to a wide audience. Sadly, it is commonly the only way data is presented... That said, we need to get that info; the process of extracting information from web pages is knows as web scraping, and note that's is a very fragile process: every time the webpage changes, it's likely you'll have to modify the code that parses it. Beautiful Soup Documentation — Beautiful Soup v4.0.0 documentation. Beautiful Soup is a Python library for pulling data out of HTML and XML files.

Beautiful Soup Documentation — Beautiful Soup v4.0.0 documentation

It works with your favorite parser to provide idiomatic ways of navigating, searching, and modifying the parse tree. It commonly saves programmers hours or days of work. These instructions illustrate all major features of Beautiful Soup 4, with examples. I show you what the library is good for, how it works, how to use it, how to make it do what you want, and what to do when it violates your expectations. Query Language. 110% Easier Web Scraping With The Yahoo Query Language Library. I've been examining and evaluating web scraping frameworks for Python over the last month and have found a few really good ones.

110% Easier Web Scraping With The Yahoo Query Language Library

The issue that I've been having though is they require too much time and effort for most people who simply want to perform quick and dirty scraping operations for small personal projects. Today while surfing dzone I found a library that I think is way better for the needs of the majority of script writers; Yahoo Query Language. "The Yahoo! Query Language is an expressive SQL-like language that lets you query, filter, and join data across Web services. With YQL, apps run faster with fewer lines of code and a smaller network footprint.

" In addition to being able to use a SQL-esque language for querying pages/services you can also use XPath selectors in the query statements to make it even easier to grab the data that you want. Beautiful Soup: We called him Tortoise because he taught us. [ Download | Documentation | Hall of Fame | For enterprise | Source | Changelog | Discussion group | Zine ] You didn't write that awful page. You're just trying to get some data out of it. Beautiful Soup is here to help. Since 2004, it's been saving programmers hours or days of work on quick-turnaround screen scraping projects. Download Python. OpenPGP Public Keys Source and binary executables are signed by the release manager or binary builder using their OpenPGP key. Release files for currently supported releases are signed by the following: Release files for older releases which have now reached end-of-life may have been signed by one of the following: Anthony Baxter (key id: 0EDD C5F2 6A45 C816)Georg Brandl (key id: 0A5B 1018 3658 0288)Martin v.

Löwis (key id: 6AF0 53F0 7D9D C8D2)Ronald Oussoren (key id: C9BE 28DE E6DF 025C)Barry Warsaw (key ids: 126E B563 A74B 06BF, D986 6941 EA5B BD71, and ED9D77D5) You can import a person's public keys from a public keyserver network server you trust by running a command like: Apprendre à programmer avec Python. Un livre de Wikilivres.

Apprendre à programmer avec Python

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. Créer une arborescence de fichiers mp3 en python. Après une récupération d’une grande quantité de mp3 (légale) sur un site, j’ai du faire un script pour renommer automatiquement les fichiers et recréer une arborescence en fonction des tags des fichiers mp3.

Créer une arborescence de fichiers mp3 en python

Suite au téléchargement, tous le fichiers étaient dans le même dossier et portaient un nom du type download_1523645.php. Extraire les emails d’un fichier mbox. En essayant de récupérer les adresses emails d’un dossier particulier sur mon logiciel de messagerie Thunderbird, je me suis aperçu que ça n’était pas vraiment possible.

Extraire les emails d’un fichier mbox

Selenium 2.20.0. Python bindings for Selenium Python language bindings for Selenium WebDriver. The selenium package is used automate web browser interaction from Python. Several browsers/drivers are supported (Firefox, Chrome, Internet Explorer, PhantomJS), as well as the Remote protocol. Web scraping with Python – the dark side of data. In searching for some information on web-scrapers, I found a great presentation given at Pycon in 2010 by Asheesh Laroia. I thought this might be a valuable resource for R users who are looking for ways to gather data from user-unfriendly websites. The presentation can be found here: Highlights (at least from my perspective) Screen scraping is not about regular expressions. It is just too hard to use pattern matching for these tasks, as the tags can change regularly and have significant maintenance issues.BeautifulSoup is the go-to html parser for poor quality source. Fichiers CSV en Python.

Le format CSV permet d'enregistrer des données tabulaires dans un fichier texte. Les enregistrements y sont stockés ligne par ligne. Firefox - Groupes d'onglets. Python 2.7 Tutorial Pt 15 Tkinter GUI. Python 2.7 Tutorial Pt 12 SQLite. Python 2.7 Tutorial Pt 13 Website Scraping. Webscraping with Python and BeautifulSoup. Recently my life has been a hype; partly due to my upcoming Python addiction. There’s simply no way around it; so I should better confess it in public. I’m in love with Python. It’s not only mature, businessproof and performant, but also benefits from sleekness, great performance and is just so much fun to write.

It’s as if I were in Star Trek and only had to tell the computer what I wanted; never minding how the job actually it is done. Even my favourite comic artist(besides Scott Adams, of course..) took up on it; so my feelings have to be honest. In this short tutorial, I’m going to show you how to scrape a website with the 3rd party html-parsing module BeautifulSoup in a practical example. First of, place BeautifulSoup.py in your modules directory. What we will do: go to dict.ccenter a search word into the webformsubmit the formread the resultparse the html codesave all translationsprint them You can either read the needed coded on the fly or download it. I wish you all the best. Web scraping with python. Build a basic Web scraper in Python. There are times when your programs need to access the Web without worrying about the details of the mark-up. In this example we write a HTML scraper using the Python parsing library BeautifulSoup.

The Web holds a truly awe inspiring amount of information, which we're all usually happy enough to access through our Web browser. There are times, however, where your programs need to access it, and you don't want to worry about the details of the HTML mark-up. There are thousands of HTML (or SGML, or XML) parsing libraries for hundreds of languages out there, but for this example we use a Python library called BeautifulSoup which takes care of almost all of the work for you. The BeautifulSoup library is an extremely helpful tool to have at your disposal, since it not only gives you functions to search and modify your parse tree, but it also handles the broken and malformed HTML you're likely to encounter on an average Web page.

You can download the library at its Web page. That's it. Listing A. Web scraping with python. Python Quick Hacks and Codes.