- lxml - Pythonic binding for the C libraries libxml2 and libxslt.
- boto - Python interface to Amazon Web Services
- Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
- Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
- PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
- Celery - Task queue to distribute work across threads or machines.
- pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## This is the same as | |
arr = ['test ', 'this', ' thing '] | |
[x.trim() for x in arr] | |
## This | |
vals = [] | |
for x in arr | |
vals.append(x.trim()) | |
return vals |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn bkgWrkr = | |
( python.execute(" | |
import thread; | |
import time; | |
def crap(): | |
for i in range( 10): | |
print 'Love', i | |
print time.strftime( '%c') | |
time.sleep( 5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Callback(object): | |
def __init__(self, func, *args, **kwargs): | |
self.func = func | |
self.args = args | |
self.kwargs = kwargs | |
def __call__(self, *args): | |
return self.func( *self.args, **self.kwargs ) | |
and this to call it | |
mc.menuItem(l='Remove set from scene', c=Callback(self.stripObject, obj, member, 1, selButton)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""This provides a lineno() function to make it easy to grab the line | |
number that we're on. | |
Danny Yoo ([email protected]) | |
""" | |
import inspect | |
def lineno(): | |
"""Returns the current line number in our program.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Author: Greg Torrn | |
script: changeMayaWindowColor | |
'''from maya import cmds | |
import colorsys | |
import random | |
h = round(random.uniform(0.0, 1.0), 2) | |
s = round(random.uniform(0.0, 1.0), 2) | |
v = round(random.uniform(0.1, 0.5), 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def changeMayaWindowColor(color=None): | |
""" | |
Colorize Maya background | |
""" | |
if not color: | |
randColor = random.randint(0, 128) | |
if 60< randColor > 75: | |
randColor = 80 | |
randIndex = random.randint(0, 2) | |
colors = [50, 60, 65] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import OpenImageIO | |
exr_filPath = 'x:/project/testfolder/testImage.exr' | |
def edit_exr( exr_filPath): | |
#renames Channels | |
newimg = OpenImageIO.ImageBuf(exr_filPath) | |
#adds metadata | |
newimg.specmod().attribute("subRound","r2") |
OlderNewer