ronnix/fabtools - GitHub How To Install and Configure Django with Postgres, Nginx, and Gunicorn Prerequisites This tutorial assumes you have already set up your droplet (VPS) with Debian 7 or a similar distro of Linux (such as Ubuntu). If you have not already done this, please follow the tutorial on setting up a droplet here. For convenience, I've broken this tutorial into two parts. The first part (steps 1 - 6) covers installation only. Step One: Update Packages Before we do anything, we need to make sure that all the packages installed on our VPS are up to date. sudo apt-get update sudo apt-get upgrade The first command downloads any updates for packages managed through apt-get. Step Two: Install and Create Virtualenv Installing virtualenv is very simple. sudo apt-get install python-virtualenv That's all there is to it! sudo virtualenv /opt/myenv Notice that a new directory "myenv" was created in the "/opt" directory. Step Three: Install Django Now we need to activate our virtualenv so that when we install Python packages they install to our virtualenv. source /opt/myenv/bin/activate
Python Imaging Library (PIL) The Python Imaging Library (PIL) adds image processing capabilities to your Python interpreter. This library supports many file formats, and provides powerful image processing and graphics capabilities. Status The current free version is PIL 1.1.7. Support Free Support: If you don't have a support contract, please send your question to the Python Image SIG mailing list. You can join the Image SIG via python.org's subscription page, or by sending a mail to email@example.com. You can also ask on the Python mailing list, firstname.lastname@example.org, or the newsgroup comp.lang.python. Downloads The following downloads are currently available: Additional downloads may be found here. For a full list of changes in this release, see this page. If the Windows installer cannot find a Python interpreter, you may have to register your interpreter. For a full list of changes in this release, see this page.
Git alias pour être plus productif – Exemples astuces git alias Les alias sont des raccourcis vers des commandes de Git. Fini les répétitions et autres saisies de commandes rébarbatives ! Pour ajouter de nouveaux alias, créez ou éditez la section [alias] de l’un des fichiers qui suivent (voir les exemples du billet pour avoir une information sur la syntaxe) : ~/.gitconfig pour en bénéficier dans tous vos dépôts..git/config d’un projet pour restreindre son accès à cet unique projet. Il est également possible de recourir à la commande git config : $ git config --global alias.st 'status' Ici, la commande git st devient un alias de git status. Note : supprimer le flag --global va ajouter l’alias dans le scope du projet courant. Table des matières Mes alias Voici les alias que j’utilise dans le scope global, en provenance donc de mon fichier ~/.gitconfig : Des raccourcis pour les utilisateurs de SVN [alias] st = status df = diff co = checkout ci = commit br = branch svnpull = svn rebase svnpush = svn dcommit Annuler le dernier commit Éditer le dernier commit
Parser Combinators Made Simple April 18, 2011 # Parsing theory has been around for quite a long time, but it is often thought of as magic by the swarms of people who haven't bothered to read about it, and see how plain and dry it actually is. Algorithms for parsing LR(k) grammars (meaning Left-to-right, Right-most derivation, k tokens lookahead) for instance, normally just traverse a state machine that was computed before hand (either by hand, or by using a parser generator such as bison or yacc). Sure, there are many things to trip on, tedious to track down ambiguities, and other issues, but the general theory of parsing has remained unchanged for years—one might say, it is a solved problem. When learning about parsing for the first time though, the idea of a recursive descent parser is often taught first. This sounds boring and tedious, and in fact is. In order to build a parser from the ground up, we need to think about what a parser actually is. In order to use chartest, we pass it a predicate, like so: Success!
Easy Facebook Scripting in Python « Heterogenous Mixture UPDATED: fbconsole Pypi Package and Github Repository Sometimes you just want to write a little script using Facebook’s api that updates your status, or downloads all your photos, or deletes all those empty albums you accidentally created. In order to streamline my writing of one-off facebook scripts, I created a micro api client that implements the client-side authentication flow and has a few utility functions for accessing the graph api and fql. To use this mini api client, all you have to do is put 4 lines of code at the top of your python script: Now you can specify the permissions you’ll need for your script (from the list of available api permissions) and authenticate yourself: By default, the api client makes requests as the “fbconsole” app. Once authenticated, you can make whatever calls to the graph api or fql that you want. Post a status update Fetch likes on a status update Delete a status update Upload a photo (why does python make this so hard?) Query FQL tables Like this:
Reference Guide — virtualenv 12.0.7 documentation Creating Your Own Bootstrap Scripts¶ While this creates an environment, it doesn’t put anything into the environment. Developers may find it useful to distribute a script that sets up a particular environment, for example a script that installs a particular web application. To create a script like this, call virtualenv.create_bootstrap_script(), and write the result to your new bootstrapping script. create_bootstrap_script(extra_text)¶ Creates a bootstrap script from extra_text, which is like this script but with extend_parser, adjust_options, and after_install hooks. This returns a string that (written to disk of course) can be used as a bootstrap script with your own customizations. If you include these functions, they will be called: extend_parser(optparse_parser)¶ You can add or remove options from the parser here. adjust_options(options, args)¶ You can change options here, or change the args (if you accept different kinds of arguments, be sure you modify args so it is only [DEST_DIR]).
a crossplatform framework for creating NUI applications Adding Compass to your project by Brandon Rhodes • Home The Compass CSS authoring framework has become one of the standard tools that gets installed when I start working on a new web application. I always version-control not only the .scss Sass source files that I myself write, but also the .css CSS files that Compass compiles from them. That way, anyone who checks out the project immediately gets a working web site without having to install Compass — or even having to know that it exists, if they are not themselves involved in writing the CSS. But those of us who work on the CSS do need Compass, so I have a standard technique that I copy from project to project that installs Compass into a small, local Ruby environment, providing the same kind of isolation and reproducibility that Python has taught me to know and love thanks to virtualenv. The process goes like this. First I create a compass/ directory, typically up at the top level of the project, that initially contains nothing but a pair of shell scripts. #! #!
python-dateutil - Labix Description The dateutil module provides powerful extensions to the standard datetime module, available in Python 2.3+. News 2011-03-24 dateutil 2.0 is out! Features Computing of relative deltas (next month, next year, next monday, last week of month, etc); Computing of relative deltas between two given date and/or datetime objects; Computing of dates based on very flexible recurrence rules, using a superset of the iCalendar specification. Quick example Here's a snapshot, just to give an idea about the power of the package. Suppose you want to know how much time is left, in years/months/days/etc, before the next easter happening on a year with a Friday 13th in August, and you want to get today's date out of the "date" unix system command. And here's the output: Today is: 2003-10-11 Year with next Aug 13th on a Friday is: 2004 How far is the Easter of that year: relativedelta(months=+6) And the Easter of that year is: 2004-04-11 Being exactly 6 months ahead was really a coincidence Download wkst
Toolkit - ReportLab.com The Open Source PDF library The ReportLab Toolkit is a library for programatically creating documents in PDF format. It's a robust, flexible, time-proven, industry-strength solution. It's free, open-source software written in Python. It lets you quickly and easily create or automate complex or data-driven documents. It's in production use across the world as the trusted and proven foundation of existing enterprise solutions. The library implements three main layers: A graphics canvas API allowing you to 'draw' PDF pages and also create many of the special features of PDF files (outline entries, links and so on) A charts and widgets library for creating reusable data graphics, including many common business and financial charts A flexible page layout engine - PLATYPUS ("Page Layout and TYPography Using Scripts") - which builds documents from components like headlines, paragraphs, fonts, tables, images, and vector graphics. Features: