background preloader

Python Ecosystem - An Introduction » mirnazim.org

Python Ecosystem - An Introduction » mirnazim.org
When developers shift from PHP, Ruby or any other platform to Python, the very first road block they face (most often) is a lack of an overall understanding of the Python ecosystem. Developers often yearn for a tutorial or resource that explains how to accomplish most tasks in a more or less standard way. What follows is an extract from the internal wiki at my workplace, which documents the basics of the Python ecosystem for web application development for our interns, trainees and experienced developers who shift to Python from other platforms. This is not a complete resource. My target is to make it a work in perpetual progress. Intended Audience This is not about teaching Python - the programming language. I am assuming you are working on Linux (preferably Ubuntu/Debian) or a Linux-like operating system. Search the web for the best possible ways of installing Python on your operating system. The version confusion TL;DR: Python 2.x is the status quo; Python 3 is the shiny new thing. Related:  Python

Learn Python - Free Interactive Python Tutorial Tutorial Part 2: Adding a JIT This is the second part of a tutorial written by Andrew Brown. The first part described how to write an interpreter with PyPy. Adding JIT Translating RPython to C is pretty cool, but one of the best features of PyPy is its ability to generate just-in-time compilers for your interpreter. So what do we need to tell PyPy to make this happen? We also need to let it know what defines a particular execution frame. Refer back to example2.py for the following. In our main loop, there are four variables used: pc, program, bracket_map, and tape. So let's tell PyPy this info. from pypy.rlib.jit import JitDriver jitdriver = JitDriver(greens=['pc', 'program', 'bracket_map'], reds=['tape']) And we add this line to the very top of the while loop in the mainloop function: jitdriver.jit_merge_point(pc=pc, tape=tape, program=program, bracket_map=bracket_map) We also need to define a JitPolicy. def jitpolicy(driver): from pypy.jit.codewriter.policy import JitPolicy return JitPolicy() $ python . Optimizing

Mais quelle galère que la distribution de programmes Python packagés ! - Vimperator Commençons par le grand classique, car c'est le seul distribué avec Python, dans la bibliothèque standard, et sur lequel tout le monde peut compter : distutils. Le principe est qu'on écrit un fichier setup.py qui va indiquer un certain nombre de choses sur le programme : from distutils.core import setup setup(name='SeenThis', version='0.0', description='Use the SeenThis API', license='BSD', author='Stephane Bortzmeyer', author_email='stephane+seenthis@bortzmeyer.org', url=' ) Ce fichier peut ensuite être exécuté avec des options qui vont dire par exemple d'installer le paquetage (python setup.py install) ou de l'enregistrer dans le Python Package Index (PyPI) (python setup.py register). distutils a des tas de limites. Par exemple, il ne permet pas de faire des eggs, des paquetages binaires pour Python. requires=['SimpleTAL', 'FeedParser'] mais c'est purement décoratif. from setuptools import setup # python setup.py install ...

The Python Tutorial 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. The Python interpreter is easily extended with new functions and data types implemented in C or C++ (or other languages callable from C). This tutorial introduces the reader informally to the basic concepts and features of the Python language and system.

(the eff-bot guide to) The Standard Python Library (the eff-bot guide to) The Standard Python Library [home] [zone] Based in part on over 3,000 newsgroup articles written by Python veteran Fredrik Lundh since 1995, this book provides brief descriptions and sample scripts for all standard modules in the Python 2.0 library. For more information on the book and the print editions, see (the eff-bot guide to) The Standard Python Library. The effbot.org edition (based on the 2001 O’Reilly edition) Individual pages: The Standard Python Library (HTML) Printable chapters: Preface1. Note: All chapters are distributed as PDF files; to read them, you need Adobe Reader (formerly known as Adobe Acrobat) or compatible software. Updates New Modules in Python 2.1New Modules in Python 2.2New Modules in Python 2.3New Modules in Python 2.4 (coming soon)New Modules in Python 2.5 (coming soon) rendered by a django application. hosted by webfaction.

7 Major Players In Free Online Education By Jennifer Berry Imagine a world where free, college-level education was available to almost everyone. Believe it or not, you're living in that world right now. Online education has been around for decades, but in the past couple of years, interest has spiked for massive open online courses, otherwise known as MOOCs, according to Brian Whitmer, co-founder of Instructure, an education technology company that created the Canvas Network, a platform for open online courses. "Since 2012, MOOCs have caught the attention of the educational world due to their potential to disrupt how education is delivered and open up access to anyone with an Internet connection," Whitmer explains. According to "Grade Change: Tracking Online Education in the United States," a report by the Babson Survey Research Group released in January 2014, the percent of higher education institutions that currently have a MOOC increased from 2.6 percent to 5.0 percent over the past year. Coursera Standout Free Classes: edX Udemy

Jesse Noller Yup; it’s that time — every­one and their brother is doing a post look­ing back at 2011 and tak­ing stock of the good, the bad and the ugly. I’m no dif­fer­ent — 2011 was a year that largely rep­re­sented a mas­sive shift in my life’s tec­tonic plates. I’ve decided to break this reflec­tion into two related parts — the more per­sonal stuff (this one) and the big-P Python stuff — both have seen shifts and changes worth not­ing, and both are inex­tri­ca­bly tied for me. I’ve inten­tion­ally skipped all of the Python** stuff (includ­ing PyCon) that I’ve been work­ing on — that’s going to come next. Per­sonal Changes In late 2010 I was play­ing paint­ball — some­thing which every­one should try at least once — it truly is a blast. I did not real­ize that my knee has dis­lo­cated, just that my leg wasn’t work­ing. When I got home and changed, the truth came out. He told me I needed to change things. This is a photo of my from June 2010: Me, Decem­ber 2011: Now for the hard part. Chil­dren

Python for the Web - Gun.io - Vimperator The theme music for this blog post is: Air - Playground Love. Python is the best language in the world for interacting with the web, and I'm going to show you why. This article will give an extremely high level overview of how to use python for the web. There are many ways you can interact with the web using python, and this post will cover all of them. Interacting with Websites and APIs Using Python The single best package for interacting with the web using Python is 'Requests' by Kenneth Reitz. First, you'll need to install it. Once you have pip installed, run: pip install requests And now you have Requests installed! The two methods you'll need the most are GET and POST. First let's take a look at GET. That's it! Now let's look at a slightly more complicated example. Here, YOURUSERNAME and YOURPASSWORD will be send as login credentials to the server. Now, let's try a POST request to send some data TO the server. Processing JSON in Python pip install simplejson Scraping the Web Using Python

Related:  ProgrammingbeyerfpythonPynthon