background preloader

6.189 A Gentle Introduction to Programming Using Python, January IAP 2008

The Hitchhiker’s Guide to Python! — pythonguide 0.0.1 documentation Greetings, Earthling! Welcome to The Hitchhiker’s Guide to Python. This is a living, breathing guide. If you’d like to contribute, fork us on GitHub! This handcrafted guide exists to provide both novice and expert Python developers a best practice handbook to the installation, configuration, and usage of Python on a daily basis. This guide is opinionated in a way that is almost, but not quite, entirely unlike Python’s official documentation. Note The use of Python 3 is highly preferred over Python 2. Let’s get started! Getting Started with Python New to Python? Properly Install Python on your system: Using Virtualenvs with Pipenv: Python Development Environments This part of the guide focus on the Python development environment, and the best-practice tools that are available for writing Python code. Writing Great Python Code This part of the guide focuses on the best-practices for writing Python code. Scenario Guide for Python Applications Shipping Great Python Code Additional Notes

Code Like a Pythonista: Idiomatic Python In this interactive tutorial, we'll cover many essential Python idioms and techniques in depth, adding immediately useful tools to your belt. There are 3 versions of this presentation: ©2006-2008, licensed under a Creative Commons Attribution/Share-Alike (BY-SA) license. My credentials: I am a resident of Montreal,father of two great kids, husband of one special woman,a full-time Python programmer,author of the Docutils project and reStructuredText,an editor of the Python Enhancement Proposals (or PEPs),an organizer of PyCon 2007, and chair of PyCon 2008,a member of the Python Software Foundation,a Director of the Foundation for the past year, and its Secretary. In the tutorial I presented at PyCon 2006 (called Text & Data Processing), I was surprised at the reaction to some techniques I used that I had thought were common knowledge. Many of you will have seen some of these techniques and idioms before. These are the guiding principles of Python, but are open to interpretation. import this

Ajax Upload - ZURB Playground - ZURB.com You're going to need jQuery and the AJAX Upload jQuery plugin. Link them up, make sure jQuery is loaded first. Here is the JavaScript we're going to add in its entirety. You can also see it if you view the source of this page. Now let's break it down. First we attach the the AjaxUpload behavior to our file form element. new AjaxUpload('imageUpload', { Next we specify where we want to post the AJAX upload to. action: $('form#newHotnessForm').attr('action'), Set the name of the file form element that will be posted to your server. Add a class to your preview div to indicate that the image is uploading. onSubmit: function(file, extension) { $('div.preview').addClass('loading'); }, When the image has been uploaded we need to do two things. We avoid this problem by waiting to remove the loading class until after the preview image's load event fires. onComplete: function(file, response) { thumb.load(function(){ $('div.preview').removeClass('loading'); thumb.unbind(); });

Python Software Foundation News Building Skills in Python — Building Skills in Python A Programmer’s Introduction to Python Legal Notice This work is licensed under a Creative Commons License. Attribution. For any reuse or distribution, you must make clear to others the license terms of this work. Language Basics The Processing View A programming language involves two closely interleaved topics. This part describes the most commonly-used Python statements, sticking with basic numeric data types. Some of the examples in this part refer to the rules of various common casino games. We’ll provide a little background on Python in Background and History. In Simple Numeric Expressions and Output we’ll introduce the print statement (and print() function); we’ll use this to see the results of arithmetic expressions including the numeric data types, operators, conversions, and some built-in functions. We’ll introduce variables, the assignment statement, and input in Variables, Assignment and Input, allowing us to create simple input-process-output programs. Data Structures Sequences.

ColorBox - customizable lightbox plugin for jQuery 1.3 & 1.4 A lightweight customizable lightbox plugin for jQuery View Demos Released under the MIT License, source on Github (changelog) Download Install via NPM npm install jquery-colorbox Compatible with: jQuery 1.3.2+ in Firefox, Safari, Chrome, Opera, Internet Explorer 7+ Supports photos, grouping, slideshow, ajax, inline, and iframed content.Lightweight: 10KB of JavaScript (less than 5KBs gzipped).Appearance is controlled through CSS so it can be restyled.Can be extended with callbacks & event-hooks without altering the source files.Completely unobtrusive, options are set in the JS and require no changes to existing HTML.Preloads upcoming images in a photo group.Currently in use on a million-plus websites. Instructions & Help The FAQ has instructions on asking for help, solutions to common problems, and how-to examples. Usage Colorbox accepts settings from an object of key/value pairs, and can be assigned to any HTML element. Settings Public Methods Event Hooks Hey,

Planet Python Think Complexity by Allen B. Downey Buy this book from Amazon.com. Download this book in PDF. Read this book online. Description This book is about complexity science, data structures and algorithms, intermediate programming in Python, and the philosophy of science: Data structures and algorithms: A data structure is a collection that contains data elements organized in a way that supports particular operations. This book focuses on discrete models, which include graphs, cellular automata, and agent-based models. Complexity science is an interdisciplinary field---at the intersection of mathematics, computer science and physics---that focuses on these kinds of models. Free books! This book is under the Creative Commons Attribution-NonCommercial 3.0 Unported License, which means that you are free to copy, distribute, and modify it, as long as you attribute the work and don't use it for commercial purposes. Download the LaTeX source code (with figures and a Makefile) in a zip file.

10 Rock Solid Website Layout Examples Keeping It Simple Page layout is equal parts art and science. Creating something that’s visually attractive and unique takes an artist’s eye. However, there are several very easy to follow guidelines that you can use to create solid layouts that work for any number of cases. These principles include choosing and sticking to an alignment, structuring your whitespace properly and highlighting important elements through size, positioning, etc. Designers often stress out far too much about the layout process. In this article we’re going to take a look at ten very common layouts that you can find on countless sites across the web. If you’re a web designer, bookmark this page and come back the next time you get stuck laying out a page. Three Boxes This is probably the most simple layout on the list. The three boxes layout features one main graphic area followed by two smaller boxes underneath. This design is ideal for a portfolio page or anything that needs to show off a few sample graphics.

web2py I believe that the ability to easily build high quality web applications is of critical importance for the growth of a free and open society. This prevents the biggest players from monopolizing the flow of information. Hence I started the web2py project in 2007, primarily as a teaching tool with the goal of making web development easier, faster, and more secure. Over time, it has managed to win the affection of thousands of knowledgeable users and hundreds of developers. Our collective effort has created one of the most full-featured Open Source Web Frameworks for enterprise web development. As a result, in 2011, web2py won the Bossie Award for best Open Source Development Software, and in 2012 it won the Technology of the Year award from InfoWorld. As you will learn in the following pages, web2py tries to lower the barrier of entry to web development by focusing on three main goals: Ease of use. Rapid development. Security.

Think Python: How to Think Like a Computer Scientist How to Think Like a Computer Scientist by Allen B. Downey This is the first edition of Think Python. Buy this book at Amazon.com Download Think Python in PDF. Read Think Python in HTML. Example programs and solutions to some problems are here (links to specific examples are in the book). Description Think Python is an introduction to Python programming for beginners. Some examples and exercises are based on Swampy, a Python package written by the author to demonstrate aspects of software design, and to give readers a chance to experiment with simple graphics and animation. Think Python is a Free Book. If you have comments, corrections or suggestions, please send me email at feedback{at}thinkpython{dot}com. Other Free Books by Allen Downey are available from Green Tea Press. Download Precompiled copies of the book are available in PDF. Python 3.0 Most of the book works for Python 2.x and 3.0. Michael Kart at St. Earlier Versions Translations and adaptations

Related: