background preloader

The Art and Craft of Programming

The Art and Craft of Programming

Python Programming Python Programming From Wikibooks, open books for an open world Jump to: navigation, search This book describes Python, an open-source general-purpose interpreted programming language available for a broad range of operating systems. Contents[edit] Intro[edit] Overview Getting Python Setting it up Interactive mode Self Help Basics[edit] Creating Python programs Variables and Strings Basic syntax Sequences (Strings, Lists, Tuples, Dictionaries, Sets) Data types Numbers Strings Lists Tuples Dictionaries Sets Basic Math -- redundant to "Operators" Operators Control Flow Decision Control Conditional Statements Loops Functions Scoping Input and output Files Text Modules Classes Exceptions Errors Source Documentation and Comments Idioms Advanced[edit] Decorators Context Managers Reflection Metaclasses Namespace Tips and Tricks Modules[edit] Standard library modules[edit] Standard Library Regular Expression External commands XML Tools Email Threading Sockets GUI Programming Tkinter CGI interface WSGI web programming Extracting info from web pages Math

The way of the program Buy this book at Amazon.com The goal of this book is to teach you to think like a computer scientist. This way of thinking combines some of the best features of mathematics, engineering, and natural science. Like mathematicians, computer scientists use formal languages to denote ideas (specifically computations). Like engineers, they design things, assembling components into systems and evaluating tradeoffs among alternatives. The single most important skill for a computer scientist is problem solving. On one level, you will be learning to program, a useful skill by itself. 1.1 The Python programming language The programming language you will learn is Python. There are also low-level languages, sometimes referred to as “machine languages” or “assembly languages.” The advantages are enormous. Due to these advantages, almost all programs are written in high-level languages. Two kinds of programs process high-level languages into low-level languages: interpreters and compilers. input: math:

PyQt4 tutorial This is PyQt4 tutorial. The tutorial is suited for beginners and intermediate programmers. After reading this tutorial, you will be able to program non trivial PyQt4 applications. Table of contents E-book A unique e-book covering advanced features of the PyQt4 library: Advanced PyQt4 tutorial. Related tutorials To refresh your knowledge of the Python language there is a Python tutorial on ZetCode. wxPython tutorial, PyGTK tutorial and Tkinter tutorial are tutorials for other popular Python GUI bindings. Choosing the best touring bicycle (updated January 2013) | Northern Walker Non-touring cycling friends often ask me: ‘What’s the best touring bicycle you can buy?’ In many respects, it’s a hard question to answer as the choice of bike hinges on so many factors, not least the kind of journeys you are planning to undertake. In many cases, the bike in your garage or shed will do. For the purposes of this post, though, I will focus on the ‘dedicated’ touring cycle, which can be loosely categorised as ‘traditional touring cycles’, ‘expedition touring cycles’ and ‘others’ – including folding bicycles for touring. I thought it was about time I updated this post as it it generates so much traffic on this site. And if this isn’t enough to satiate your touring bike appetite, check out this site. Traditional touring cycles Very much a British institution and the prefered choice of geography teachers for years, the traditional touring cycle (usually) has a steel frame, a long wheelbase and relaxed riding position. Dawes Galaxy £1,149 Ridgeback Panorama £1249 Like this:

Test-Driven Development with Python Test-Driven Development with Python Test-Driven Development with Python Harry Percival Gillian McGarvey Rebecca Demarest Wendy Catalano Randy Comer David Futato Copyright © 2014 Harry Percival Printed in the United States of America. O’Reilly books may be purchased for educational, business, or sales promotional use. Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. While every precaution has been taken in the preparation of this book, the publisher and authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein. Praise for Test-Driven Development with Python Table of Contents © 2013, O’Reilly Media, Inc.

16 Linux Server Monitoring Commands You Really Nee... - Input Output - (Private Browsing) Want to know what's really going on with your server? Then you need to know these essential commands. Once you've mastered them, you'll be well on your way to being an expert Linux system administrator. Depending on the Linux distribution, you can run pull up much of the information that these shell commands can give you from a GUI program. However, it's a Linux administrator truism that you should run a GUI on a server only when you absolutely must. This also means that you should only start a GUI on a server when it's required; don’t leave it running. If your server starts by booting into a graphical desktop, you need to change this. Once there, find the initdefault line and change it from id:5:initdefault: to id:3:initdefault: If there is no inittab file, create it, and add the id:3 line. Once your server is running at init 3, you can start using the following shell programs to see what's happening inside your server. iostat meminfo and free cat /proc/meminfo mpstat netstat nmon pmap sar top

The Programming Historian - 1st edition Python data tools just keep getting better Here are a few observations inspired by conversations I had during the just concluded PyData conference 1 . The Python data community is well-organized: Besides conferences ( PyData , SciPy, EuroSciPy ), there is a new non-profit ( NumFOCUS ) dedicated to supporting scientific computing and data analytics projects. The list of supported projects are currently Python-based, but in principle NumFOCUS is an entity that can be used to support related efforts from other communities. It’s getting easier to use the Python data stack: There are tools that facilitate the dissemination and sharing of code and programming environments. There are many more visualization tools to choose from: The 2D plotting tool matplotlib is the first tool enthusiasts turn to, but as I learned at the conference, there are a number of other options available. In addition, new tools like H20 and wise.io plan to make their massively scalable algorithms accessible via Python.

Effective Django — Effective Django 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. This will ensure that concatenation occurs in linear time across various implementations.Comparisons to singletons like None should always be done with is or is not, never the equality operators.Also, beware of writing if x when you really mean if x is not None -- e.g. when testing whether a variable or argument that defaults to None was set to some other value.

Related: