background preloader

Learning Python Programming Language Through Video Lectures

Learning Python Programming Language Through Video Lectures
One of the upcoming projects I am doing (I will reveal it in one of the next blog posts.) is going to be written entirely in Python. I have a good understanding of Python but, same as I had with JavaScript, I have little experience doing projects from the ground up in it. Update: the project was redditriver.com, read designing redditriver.com (includes full source code). Before diving into the project I decided to take a look at a few Python video lectures to learn language idioms and features which I might have not heard of. Finding Python video lectures was pretty easy as I run a free video lecture blog. First Python Lecture: Python for Programmers Interesting moments in the lecture: [07:15] There are several Python implementations - CPython, PyPy, IronPython and Jython. Okay, this talk was a very basic talk and it really was an introduction for someone who never worked in Python. Second Python Lecture: Advanced Python or Understanding Python Question and answer session: PS.

PEP 8 -- Style Guide for Python Code Code should be written in a way that does not disadvantage other implementations of Python (PyPy, Jython, IronPython, Cython, Psyco, and such).For example, do not rely on CPython's efficient implementation of in-place string concatenation for statements in the form a += b or a = a + b. This optimization is fragile even in CPython (it only works for some types) and isn't present at all in implementations that don't use refcounting. In performance sensitive parts of the library, the ''.join() form should be used instead.

Invent Your Own Computer Games with Python - Learn how to program with a free ebook programming tutorial Chapter 1 Read online: Chapter 1 - Installing Python Videos: Chapter 2 Read online: Chapter 2 - The Interactive Shell Chapter 3 Read online: Chapter 3 - Strings Download source: hello.py Copy source to clipboard: Use the online diff tool to find typos in your code: hello.py Chapter 4 Read online: Chapter 4 - Guess the Number Download source: guess.py Use the online diff tool to find typos in your code: guess.py Chapter 5 Read online: Chapter 5 - Jokes Download source: jokes.py Use the online diff tool to find typos in your code: jokes.py Chapter 6 Read online: Chapter 6 - Dragon Realm Download source: dragon.py Use the online diff tool to find typos in your code: dragon.py Chapter 7 Read online: Chapter 7 - Using the Debugger Chapter 8 Read online: Chapter 8 - Flow Charts Chapter 9 Read online: Chapter 9 - Hangman Download source: hangman.py Use the online diff tool to find typos in your code: hangman.py Chapter 10 Read online: Chapter 10 - Tic Tac Toe Download source: tictactoe.py Chapter 11 Download source: bagels.py

Tutorial - Learn Python in 10 minutes - Stavros' Stuff NOTE: If you would like some Python development done, my company, Stochastic Technologies, is available for consulting. 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. Preliminary fluff So, you want to learn the Python programming language but can't find a concise and yet full-featured tutorial. Properties Python is strongly typed (i.e. types are enforced), dynamically, implicitly typed (i.e. you don't have to declare variables), case sensitive (i.e. var and VAR are two different variables) and object-oriented (i.e. everything is an object). Getting help Help in Python is always available right in the interpreter. >>> help(5)Help on int object:(etc etc) >>> dir(5)['__abs__', '__add__', ...] >>> abs. Syntax Python has no mandatory statement termination characters and blocks are specified by indentation. Data types You can access array ranges using a colon (:).

Understanding Python's "with" statement Fredrik Lundh | October 2006 | Originally posted to online.effbot.org Judging from comp.lang.python and other forums, Python 2.5’s new with statement (dead link) seems to be a bit confusing even for experienced Python programmers. As most other things in Python, the with statement is actually very simple, once you understand the problem it’s trying to solve. Consider this piece of code: set things up try: do something finally: tear things down Here, “set things up” could be opening a file, or acquiring some sort of external resource, and “tear things down” would then be closing the file, or releasing or removing the resource. If you do this a lot, it would be quite convenient if you could put the “set things up” and “tear things down” code in a library function, to make it easy to reuse. def controlled_execution(callback): set things up try: callback(thing) finally: tear things down def my_function(thing): do something controlled_execution(my_function) This wasn’t very difficult, was it?

Python from Scratch – Functions and Modules Welcome back to the Python from Scratch series. In the previous lesson, we learned how to use variables and control structures to store and manipulate data. Be sure to review it if you need a refresher! Video Tutorial Press the HD button for the clearest picture. Transcript In today's tutorial, we're going to be looking at functions - what they are, how they work, and how to make your own. Functions - Writing your Own Functions are an important step to cover, when introducing additional complexity into your programming. A function is a named container for a block of code. There are two types of functions: the ones that you write yourself and include in your code, and the ones that are included in Python natively, which carry out common procedures, such as converting an integer to a string, or finding the length of a string. We're going to look at writing a simple function now, and demonstrate how it can be useful in the real world code. A simple Example Arguments Argument Defaults str() len() os

Python Tools for Visual Studio 6 Free E-Books on Learning to Program with Python Python is an increasingly popular language, and it's also a favorite language teaching first time programmers. We've compiled a list of beginner's books to choose from. Just because they're free doesn't mean they aren't good. Some of the books listed here have been used in courses such as MIT's Introduction to Computer Science and Programming course and University of California, Davis' Basic Concepts of Programming course. A Byte of Python A Byte of Python is a beginner's book on Python by Swaroop C H. It's been used in several academic programs, such as the above mentioned UC Davis course, and by the NASA Jet Propulsion Laboratory. It's available for both Python 2.X and 3.0, but only the 3.0 version is still updated. Learn Python the Hard Way Learn Python the Hard Way is a beginner's programming book written by Zed Shaw. Shaw is known as the creator of the Mongrel and Mongrel2 Web servers, and more recently as the author of this lively manifesto. Non-Programmer's Tutorial for Python See Also

IronPython.net / PLEAC-Python Following the Perl Cookbook (by Tom Christiansen and Nathan Torkington, published by O'Reilly) spirit, the PLEAC Project aims to gather fans of programming, in order to implement the solutions in other programming languages. In this document, you'll find an implementation of the Solutions of the Perl Cookbook in the Python language. The latest version of Python is 2.4 but users of 2.3 and 2.2 (and in some cases earlier versions) can use the code herein. Users of 2.2 and 2.3 should install or copy code from utils.py ( [the first section provides compatability code with 2.4] Users of 2.2 should install optik ( [for optparse and textwrap] Where a 2.3 or 2.4 feature is unable to be replicated, an effort has been made to provide a backward-compatible version in addition to one using modern idioms.

Related: