learning python 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.
  • Python has similarities with [12:04] Java, [15:30] C++ and [19:05] C programming languages.
  • [15:37] Python is multi-paradigm language supporting object oriented, procedural, generic and functional programming paradigms.
  • [19:49] Python follows C standard's rationale: 1. trust the programmer; 2. don't prevent the programmer from doing what needs to be done; 3. keep the language small and simple; 4. provide only one way to do an operation.
  • [13:02] Python code is normally implicitly compiled to bytecode.
  • [13:25] Everything inherits from object.
  • [14:56] Garbage collection in classic Python happens as soon as possible.
  • [24:50] Python has strong but dynamic typing.
  • [28:42] Names don't have types, objects do.
  • [36:25] Why are there two ways to raise a number to a power (with double star ** operator and pow())? - Because pow() is a three argument function pow(x, y, z) which does x^y mod z.
  • [36:52] Python supports plain and Unicode strings.
  • [38:40] Python provides several built-in container types: tuple's, list's, set's, frozenset's and dict's.
  • [41:55] c[i:j:k] does slicing with step k.
  • [42:45] c[i:j] always has first bound included and last bound excluded.
  • [44:11] Comparisons can be "chained", for example 3 < x < 9.
  • [45:05] False values in Python are 0, "", None, empty containers and False.
  • [49:07] 'for' is implemented in terms of iterators.
  • [52:18] Function parameters may end with *name to take a tuple of arbitrary arguments, or may end with **name to take a dict of arbitrary arguments.
  • [55:39] Generators.
  • [01:00:20] Closures.
  • [01:02:00] Classes.
  • [01:05:30] Subclassing.
  • [01:07:00] Properties.
  • [01:14:35] Importing modules.
  • [01:16:20] Every Python source file is a module, and you can just import it.
  • [01:17:20] Packages.

Okay, this talk was a very basic talk and it really was an introduction for someone who never worked in Python. I could not find many interesting points to point out from the lecture, so the last 8 points are just titles of topics covered in the lecture.

Second Python Lecture: Advanced Python or Understanding Python

Interesting moments in the lecture:

  • [03:18] Python is designed by implementation.
  • [04:20] Everything is runtime (even compiletime is runtime).
  • [04:42] A namespace is a dict.
  • [05:33] A function is created by having its code compiled to code object, then wrapped as a function object.
  • [10:00] Everything is an object and a reference, except variables.
  • [11:00] Python has 3-scopes rule - names are either local, global or builtin.
  • [11:12] Global names mean they exist in a module, not everywhere!
  • [14:02] 'import mod' statement is just a syntactic sugar for mod = __import__("mod").
  • [14:15] sys.modules contains a list of cached modules.
  • [14:30] You may set the value of a module name in sys.modules dict to None, to make it unimportable.
  • [15:20] Mutable objects are not hashable, most immutable objects are hashable.
  • [18:05] Assignments, type checks, identity comparison, 'and or not', method calls are not object hooks.
  • [22:15] Any Python object has two special attributes __dict__ which holds per object data and __class__ which refers to the class.
  • [27:18] Iterators are not rewindable, reversible or copyable.
  • [29:04] Functions with yield return generators.
  • [39:20] "New" style classes unified C types and Python classes.
  • [47:00] __slots__ prevent arbitrary attribute assignments.
  • [48:10] __new__ gets called when the object gets created (__init__ gets called when the object has already been constructed).
  • [01:01:40] Inheritance is resolved using a C3 Method Resolution Order algorithm.
  • [01:04:57] Unicode in Python.
  • [01:06:45] UTF8 is not Unicode, it's a Unicode encoding!
  • [01:11:50] codecs module automatically converts between encodings.
  • [01:13:00] Recommended reading - Functional Programming HOWTO and Python source code ;)

This lecture gets pretty complicated towards the end as the lecturer goes deep into subjects which require adequate experience with Python.

Third Python Lecture: Python: Design and Implementation

Interesting moments in the lecture:

  • [01:27] Python started in late 1989, around December 1989.
  • [01:57] Python's named after Monty Python's Flying Circus.
  • [06:20] Python was first released to USENET and then a public group comp.lang.python was started.
  • [08:06] Guido van Rossum, the author of Python, moved to US in 1995.
  • [09:58] Python will never become a commercial project thanks to Python Software Foundation, founded in 2001.
  • [11:23] Python origins go back to ideas from ABC programming language (indentation for statement grouping, simple control structures, small number of data types).
  • [13:01] Being on ABC's implementation team, Guido learned a lot about language design and implementation.
  • [16:37] One of the main goals of Python was to make programmer's productivity more important than program's performance.
  • [17:10] Original positioning of Python was in the middle between C and sh.
  • [21:13] Other languages, such as, Modula-3, Icon and Algol 68 also had an impact on Python's implementation details.
  • [24:32] If a feature can be implemented as a clear extension module, it is always preferable to changing the language itself.
  • [25:23] The reason Python uses dictionaries for namespaces is that it required minimal changes to the stuff the language already had.
  • [28:11] Language features are accepted only if they will be used by a wide variety of users. A recent example of a new language feature is the 'with' statement.
  • [31:13] Question from the audience - "Can't the 'with' statement be implemented via closures?"
  • [34:25] Readable code is the most important thing.
  • [37:57] To add a new language feature, PEP, Python Enhancement Proposal has to be written.
  • [40:47] Python's goal was to be cross-platform (hardware & OS) right from the beginning.
  • [47:09] Python's lexer has a stack to parse indentation.
  • [49:20] Two passes are run over abstract syntax tree, one to generate symbol table and the other to produce bytecode.
  • [50:20] Bytecode opcodes are very high level, close to conceptual primitive operations in language, rather close to what hardware could do.
  • [01:02:54] Jython generates pure Java bytecode.
  • [01:03:01] Jython's strings are always Unicode.
  • [01:06:45] IronPython is as fast or even faster than CPython.

Question and answer session:

  • [01:08:57] Have there been attempts to compile Python to machine code (for example, x86)?
  • [01:13:46] Why not use simple tail recursion?
  • [01:16:09] How does the garbage collection work?

This video lecture gives an insight on history and development ideas of Python language. I believe it is important to know the history and details of the language design decisions to be really competent in it.

There are a few more lectures I have found:

There is also some great reading material available:

Have fun learning Python!

PS. Do you know any other video lectures on Python that I haven't mentioned here? Feel free to post them in the comments! Thanks! :)

Comments

March 07, 2008, 18:58

Great Videos. Our Developers will definate want to check these out.
You got my del.icio.us bookmark!

March 07, 2008, 20:15

I did an Introduction to Python tutorial in 2003 at the first Plone Conference in New Orleans...

http://plone.org/events/conferences/new-orleans-2003/video/index_html#python

There's a little bit of Zope/Plone content at the end, but the bulk of the talk is about Python.

Briguy Permalink
March 07, 2008, 20:19

Great List!

Heads up: Under the additional lectures, "Python 300" should be "Python 3000" (the next major version of Python.)

No need to publish this comment.

March 07, 2008, 20:26

Jim, thank you! I added your lecture to additional lectures.

Briguy, oh, right. Just fixed it :)

Lukas, thank you for the add! May I suggest to subscribe to RSS, as well? :)

March 07, 2008, 22:00

For 184 more Python screencast tutorials - including some by significant members of the Python community, see ShowMeDo's Python Tutorial Videos.
Topics include core Python, wxPython, Django, how-to-code, learning to debug and famous modules.
Ian (ShowMeDo's co-founder).

jay Permalink
May 21, 2010, 08:29

You have to pay for most of the showmedo videos. It's a waste of time looking there. This guy is only trying to get money

Roman Permalink
March 08, 2008, 15:14

Tupo: next blog post -> next blog posts.

robert Permalink
March 17, 2008, 06:28

good post, thanks

April 04, 2008, 07:36

Hey!

Thanks for the great post!

mikko Permalink
July 27, 2008, 12:11

Maybe you've omitted these on purpose, but I thought I'd mention them. They're two more lectures on Python by Martelli.

Painless Python 1/2:
http://youtube.com/watch?v=bDgD9whDfEY

Painless Python 2/2:
http://youtube.com/watch?v=y7vwZ20SDzc

They're part of Google I/O 2008 (whatever that is), where there is also a talk by Guido, aptly named "Python, Django, and App Engine":
http://youtube.com/watch?v=v1gTI4BOPUw

November 20, 2008, 08:57

your ebooks and slides is very good .thank u

alex Permalink
January 13, 2009, 07:10

Thank you so much to the original poster for all the efforts. The python (as well as the JScript) tutorials are greatly appreciated!

Cheers....

March 09, 2009, 09:27

It is a good idea to mention that in Python you can type

import this

and see a short list of rules of thumb.

March 11, 2009, 04:49

Hi,

You can try the Book "A byte of Python" you can find it here:

http://www.swaroopch.com/notes/Python

and its free for download, you can download it from:

http://www.swaroopch.com/files/byteofpython/byte_of_python_v191.pdf

Its a good book for newbies.

Nachiket Sakinal Permalink
April 09, 2009, 16:38

Hi I am very glad to see this website.
Actually I am very interested in this field.
So please send me some tricks of the computer.
Thanking You

hemhy Permalink
April 21, 2009, 22:57

thank you
Is there any job chance

rosk Permalink
August 30, 2009, 19:51

Tens of videos from Pycon 2009 are available at

http://pycon.blip.tv/

The tricky part is to find the good ones.

September 21, 2010, 11:39

good tutorial!

December 23, 2010, 04:16

Thanks for sharing. I am building some software and a website to enable free open learning. Along with core CS courses I was looking for some Python videos, and I found your blog post very useful.

José Ruiz Permalink
November 20, 2011, 00:56

The presentation was very nice. However python has much more similarity to other programming languages than C/C++ and java. For example smalltalk, Lisp, I even read somewhere that it borrowed some stuff from Modula-3. It would have been nice to mention it :)

sanjay gns Permalink
January 16, 2012, 13:17

thank u :......:

Leave a new comment

(why do I need your e-mail?)

(Your twitter name, if you have one. (I'm @pkrumins, btw.))

Type first 3 letters of your name: (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.

Advertisements