background preloader

Python

Facebook Twitter

Introduction — Tornado 5.1.1 documentation. Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.

Introduction — Tornado 5.1.1 documentation

By using non-blocking network I/O, Tornado can scale to tens of thousands of open connections, making it ideal for long polling, WebSockets, and other applications that require a long-lived connection to each user. Tornado can be roughly divided into four major components:

Notebook

[] Today we'll look at performing parallel computations with IPython.

[]

Much of this material will draw from resources available online, including Parallel computing is generally very difficult, and IPython provides primitives for a number of scenarios, including: Single program, multiple data (SPMD) parallelismMultiple program, multiple data (MPMD) parallelismTask farmingData parallel computationCoordination of distributed processesCombinations of these approachesCustom user defined approaches. More about interactive graphs using Python, d3.js, R, shiny, IPython, vincent, d3py, python-nvd3. I recently found this url The Big List of D3.js Examples.

More about interactive graphs using Python, d3.js, R, shiny, IPython, vincent, d3py, python-nvd3

As d3.js is getting popular - their website is pretty nice -, I was curious if I could easily use it through Python. Pylab_examples example code: gradient_bar.py — Matplotlib 1.4.3 documentation. (Source code, png, hires.png, pdf)

pylab_examples example code: gradient_bar.py — Matplotlib 1.4.3 documentation

Web Applications. As a powerful scripting language adapted to both fast prototyping and bigger projects, Python is widely used in web application development.

Web Applications

Context. WebFrameworks. A Web framework is a collection of packages or modules which allow developers to write Web applications (see WebApplications) or services without having to handle such low-level details as protocols, sockets or process/thread management.

WebFrameworks

The majority of Web frameworks are exclusively server-side technology, although, with the increased prevalence of AJAX, some Web frameworks are beginning to include AJAX code that helps developers with the particularly tricky task of programming (client-side) the user's browser. At the extreme end of the client-side Web Frameworks is technology that can use the web browser as a full-blown application execution environment (a la gmail for example): see Web Browser Programming for details. Generally, frameworks provide support for a number of activities such as interpreting requests (getting form parameters, handling cookies and sessions), producing responses (presenting data as HTML or in other formats), storing data persistently, and so on. Développer une WebApp en Python. Objectifs du tutoriel: Apprendre les bases de Python au travers d’un projet pluridisciplinaire.

Développer une WebApp en Python

Dans ce projet, je vous propose de développer de A à Z une application Web client/serveur basée sur une architecture Model2 structurée comme un MVC. Les points suivants sont abordés: Principe d’une WebApp (application Web) avec PythonConception Orientée Objet (Model2 et MVC)Utilisation (souvent basique) de quelques modules de la PSL (Python Standard Library) : Expression régulièresLecture/Écriture dans des fichiersBases de données Sqlite3Serveur Web httpSérialisationRequêtes httpModule cgi (Common Gateway Interface)Tests unitairesThreadsNotions de Javascript et de HTML Template HTML et CSSUtilisation de jQueryUI (le widget datepicker)Manipulation de l’API Highcharts en javascript pour l’affichage de graphiques.

Python: It's a Trap - The Hiltmon. TL;DR: Python is the best language for quantitative scripting (because of its libraries).

Python: It's a Trap - The Hiltmon

But it’s a trap. Almost all programmers and libraries require Python 2 when Python 3 is out and way better. Choosing to use an old language for new project traps us into supporting old languages, libraries and platforms. And that’s not smart. The intent of this post is to point out this odd stagnation and encourage the migration and adoption of Python 3, or, as it has happened in the past, we’ll have to look elsewhere for a solution. Python 3 Is Killing Python - the zero bit stream. Python 3 is easily the worst thing to happen to the Python community.

Python 3 Is Killing Python - the zero bit stream

I remember when I first used Python, I had been spending a lot of time in C++ land, and Python was like a revelation. I could open up a text editor and have a working program in seconds or minutes, not hours or days. Python 3 is killing Python. TL;DR Imo specific evidence directly contradicts chromatic's assertions about the intentions, plans and actions of the Rakudo dev leads (Patrick and jnthn).

Python 3 is killing Python

My assessment, and chromatic's too I think, is there was a growing breakdown in trust that blew up in 2011 with serious consequences for both Rakudo and Parrot. > When Rakudo announced it wanted to rewrite NQP to run on multiple backends What announcement are you speaking of? In the past you seem to have suggested they announced this in late 2010 or early 2011. Available public evidence, including a github repo, makes it clear that one of the primary objectives of the 2009 NQP rewrite was to transition to a multiple backend architecture, and there was no attempt to hide this.[1] > First, because Parrot developers didn't treat Rakudo as the most important hosted language.

> Second, because Parrot didn't provide the features Rakudo wanted. 18.5. asyncio – Asynchronous I/O, event loop, coroutines and tasks — Python 3.4.2 documentation. Source code: Lib/asyncio/ This module provides infrastructure for writing single-threaded concurrent code using coroutines, multiplexing I/O access over sockets and other resources, running network clients and servers, and other related primitives. Here is a more detailed list of the package contents: Asynchronous programming is more complex than classical “sequential” programming: see the Develop with asyncio page which lists common traps and explains how to avoid them.

Enable the debug mode during development to detect common issues. Table of contents: Twisted 14.0.2. Twisted is an event-driven networking engine for Python. Testing Your Code. Testing your code is very important. Getting used to writing the testing code and the running code in parallel is now considered a good habit. Used wisely, this method helps you define more precisely your code’s intent and have a more decoupled architecture. Some general rules of testing: A testing unit should focus on one tiny bit of functionality and prove it correct.Each test unit must be fully independent. Each of them must be able to run alone, and also within the test suite, regardless of the order they are called. The Basics Unittest. Pip 1.5.6. Package Index > pip > 7.1.2 Not Logged In Status Nothing to report. Jinja2 (The Python Template Engine) Online Python Tutor - Learn programming by visualizing code execution. The IPython Notebook — IPython.

Welcome to Python.org.