background preloader

Python Tips, Tricks, and Hacks

http://www.siafoo.net/article/52

Related:  RiggingWiki, BlogpyNils

Syntax - Python ############################################################################## # name: main # purpose: entry point of the script ############################################################################## # sys.argv is a list of command line argument strings (pos 0 is script name) if __name__ == "__main__" : print "hello world" # if no comma (,) at end \n is auto included ############################################################################## # name: main # purpose: show the basic conditionals ############################################################################## # regular c style if statement if (value is not None ) and (value == 1): # is tests for same object print "value equals 1" , print " more can come in this block" # if-else block if (job == "millionaire" ) or (state != "dead" ): # !

Intermediate and Advanced Software Carpentry in Python Welcome! You have stumbled upon the class handouts for a course I taught at Lawrence Livermore National Lab, June 12-June 14, 2007. These notes are intended to accompany my lecture, which was a demonstration of a variety of "intermediate" Python features and packages. Because the demonstration was interactive, these notes are not complete notes of what went on in the course. (Sorry about that; they have been updated from my actual handouts to be more complete...)

2.1. Process for Contributing Code — edX Developers Guide documentation Open edX is a massive project, and we would love you to help us build the best online education system in the world – we can’t do it alone! However, the core committers on the project are also developing features and creating pull requests, so we need to balance reviewing time with development time. To help manage our time and keep everyone as happy as possible, we’ve developed this document that explains what core committers and other contributors can expect from each other. The goals are:

Using Google App Engine to Extend Yahoo! Pipes Update: A commenter pointed out that you can from django.utils import simplejson instead of including it. Makes this even easier. Yahoo! Pipes has always been a great tool for manipulating data but often you have to go to great contortions to get it to do what you want because of its very simple data flow programming model. Use setup.py to Deploy Your Python App with Style Question: You've just written an awesome Python app, and you want to share it with the world. What do you do? Answer: You use setuptools and distutils to deploy your application.

rigging Cartoony eyes in maya? To Iotrez: You say it works quite well most of the time f3rry. Are there any specific situations where this setup doesn't work so well? Yes, When you are streching the whole head up and still having (or going to do) your eyes squint (evil eyes) - squashed - then you are going to see some distortion Is it common to have the eyelids part of the head mesh and not seperate spheres? To do this could you create blendshape targets using the whole head for the blinking, by adjusting the vertices making up the eyelids.

The “Invent with Python” Blog I've written an article for OpenSource.com called APIs, not apps: What the future will be like when everyone can code, where I write about a coming future where programming ability is in the hands of everyone. Excerpt: Despite this hype, I do think that coding will become a more widespread and routine skill in the years to come. Programmable technology will continue to pervade more parts of our life, computers will continue to become more accessible to a wider population, and the world will continue to become more complex. Understanding coding (and debugging) will naturally go with it....These are areas where non-programmers can significantly boost their productivity by learning to code. This is different from everyone becoming a software engineer.

"Brackets" Review Blog Welcome back for another weekly review series! When you open first "Electronic Station" the first mission that you encounter is the classic "Brackets" mission. This is a simple, but interesting and useful mission. "Brackets" can be solved with a wide variety of methods, and CiO players have certainly come up with some clever and ingenious solutions to it. Description You are given an expression with numbers, brackets and operators.

Blog: "Internet lifestream with Django" My goal was to archive and display my internet lifestream. My first approach was writing a client for each API of the social networks that I'm in. This turned out to be a complete waste of time and effort. All that I needed after all was a FriendFeed account that would centralize all my feeds. Archiving and displaying your entries with Django is quite simple. First of all, you need to download the Python FriendFeed API client.

Related: