Talks and Tutorials Here are links to selected talks and tutorials given at user-group meetings and conferences. Most of these talks can also be found on SlideShare. I also have a YouTube Channel where you can find videos. Most of these talks can also be found on pyvideo.org. Builtin Superheroes. Fear and Awaiting in Async: A Savage Journey to the Heart of the Coroutine Dream. Topics of Interest (Python Asyncio). Python Concurrency From the Ground Up: LIVE!. Modules and Packages: Live and Let Die! Generators: The Final Frontier [ video. ] Presented at PyCon 2014 in Montreal, April 10, 2014. Discovering Python. Learn Python Through Public Data Hacking [ video ]. Python 3 Metaprogramming [ video ]. Python: A Toy Language. Let's Talk About PyPy. Low Level RPython. Understanding RPython. Embracing the Global Interpreter Lock (GIL). In Search of the Perfect Global Interpreter Lock. Using Python 3 to Build a Cloud Computing Service for my Superboard II [PDF]. Mastering Python 3 I/O (rev 2).
Introduction · A Byte of Python Don’t Slurp: How to Read Files in Python | Corps of Engineers A few weeks ago, a well-intentioned Python programmer asked a straight-forward question to a LinkedIn group for professional Python programmers: What’s the best way to read file in Python? Invariably a few programmers jumped in and told our well-intentioned programmer to just read the whole thing into memory: f = open('/path/to/file', 'r+') contents = f.read() Just to mix things up, someone followed-up to demonstrate the exact same technique using ‘with’ (a great improvement as it ensures the file is properly closed in all cases): with open('/path/to/file', 'r+') as f: contents = f.read() # do more stuff Either implementation boils down to the use of a technique we call “slurping“, and it’s by far the most common way you’ll encounter files being read in the wild. It’s quite memory inefficientIt’s slower than processing data as it is read, because it defers any processing done on read data until after all data has been read into memory, rather than processing as data is read. Like this:
Quantwiki s Python Class | Python Education | Google Developers Welcome to Google's Python Class -- this is a free class for people with a little bit of programming experience who want to learn Python. The class includes written materials, lecture videos, and lots of code exercises to practice Python coding. These materials are used within Google to introduce Python to people who have just a little programming experience. To get started, the Python sections are linked at the left -- Python Set Up to get Python installed on your machine, Python Introduction for an introduction to the language, and then Python Strings starts the coding material, leading to the first exercise. This material was created by Nick Parlante working in the engEDU group at Google. Tip: Check out the Python Google Code University Forum to ask and answer questions.
The Best of Python in 2013 It’s hard to believe that 2013 has already come and about to go. However, the year was not without some fantastic articles, tutorials, tips, and freebies spread throughout the Internet. Today, we will take some time to reflect on the most outstanding development related articles of 2013. So hurry up and review these before the Langoliers get them! Here are a few quick lists of big news, posts, and resources. Hope you enjoy! News and Releases Let’s get caught up with relevant news and releases from around the Python web development community. 1. Interesting Reads 1. Projects 1.radon Ever wonder how complex your current code base it? Thanks Pycoders Weekly.
Google Python Style Guide No whitespace inside parentheses, brackets or braces. No whitespace before a comma, semicolon, or colon. Do use whitespace after a comma, semicolon, or colon except at the end of the line. Yes: if x == 4: print x, y x, y = y, x No: if x == 4 : print x , y x , y = y , x No whitespace before the open paren/bracket that starts an argument list, indexing or slicing. Yes: dict['key'] = list[index] No: dict ['key'] = list [index] Surround binary operators with a single space on either side for assignment (=), comparisons (==, <, >, ! Don't use spaces around the '=' sign when used to indicate a keyword argument or a default parameter value. Yes: def complex(real, imag=0.0): return magic(r=real, i=imag) No: def complex(real, imag = 0.0): return magic(r = real, i = imag) Don't use spaces to vertically align tokens on consecutive lines, since it becomes a maintenance burden (applies to :, #, =, etc
Intro to Computer Science | Udacity You’ll learn the programming language Python, and you’ll explore foundational concepts in computer science. Most importantly, you’ll start thinking like a software engineer by solving interesting problems (how to build a web crawler or a social network) using computer programming. This course is a first step into the world of computer science, and whether you want to become a software engineer, or collaborate with software engineers, this course is for you. You’ll be prepared for intermediate-level computer science classes when you’ve mastered the concepts covered in this course. Build a Search Engine Throughout this course, you’ll build a search engine by learning about and producing key search engine components including a crawler, an index and a page rank algorithm. Build a Social Network
PEPs 252 and 253: Type and Class Changes Subsections The largest and most far-reaching changes in Python 2.2 are to Python's model of objects and classes. The changes should be backward compatible, so it's likely that your code will continue to run unchanged, but the changes provide some amazing new capabilities. Before beginning this, the longest and most complicated section of this article, I'll provide an overview of the changes and offer some comments. A long time ago I wrote a Web page ( listing flaws in Python's design. One of the most significant flaws was that it's impossible to subclass Python types implemented in C. Python 2.2 fixes this, and in the process adds some exciting new capabilities. You can subclass built-in types such as lists and even integers, and your subclasses should work in every place that requires the original type. Some users have voiced concern about all these changes. Personally, I think there's no need to worry. 2.1 Old and New Classes 2.2 Descriptors
Python Cost Model - 6.006 Wiki From 6.006 Wiki Python is a high-level programming language, with many powerful primitives. Analyzing the running time of a Python program requires an understanding of the cost of the various Python primitives. For example, in Python, you can write: where L, L1, and L2 are lists; the given statement computes L as the concatenation of the two input lists L1 and L2. Our goal in this section is to review various Python primitive operations, and to determine bounds and/or estimates on their running times. The Python implementation code base is here. Python Running Time Experiments and Discussion The running times for various-sized inputs were measured, and then a least-squares fit was used to find the coefficient for the high-order term in the running time. The least-squares fit was designed to minimize the sum of squares of relative error, using scipy.optimize.leastsq. The machine used was an IBM Thinkpad T43p with a 1.86GHz Pentium M processor and 1.5GB RAM. Cost of Python Integer Operations
Python and Flask Are Ridiculously Powerful As a developer, I sometimes forget the power I wield. It's easy to forget that, when something doesn't work the way I'd like, I have the power to change it. Yesterday, I was reminded of this fact as I finally got fed up with the way payments are processed for my book. Read on to find out how I created my own digital goods payment solution in an evening. When I began selling the book, I used a combination of two services (one for credit cards and another for PayPal). Additionally, I've had a terrible time trying to get Google Analytics to properly track visitor flow through the entire visit, including the checkout process. Lastly, sending out book updates is terribly time-consuming using three different processors. After receiving an email from a customer yesterday about how difficult the payment process was and informing me that I'm likely losing sales because of it, I got fed up. Clearly, it's not that complicated. Spoiler alert: the resulting application is exactly 100 lines of code.