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
#!/usr/bin/env python | |
""" | |
Copyright (c) 2012, Justin Israel (justinisrael@gmail.com) | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
* Redistributions of source code must retain the above copyright notice, |
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 code can be run from a Maya script editor | |
""" | |
import subprocess | |
import cPickle | |
print 'This value below should be a 1000:' | |
p = subprocess.Popen(["/path/to/multi_test.py", "-po"], stdout=subprocess.PIPE) | |
result = cPickle.load(p.stdout) |
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
from functools import partial | |
from subprocess import Popen, PIPE | |
from PyQt4 import QtCore, QtGui | |
## testProgram.sh | |
""" | |
#!/bin/bash |
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
#!/usr/bin/env python | |
""" | |
Playing around with QMainWindow's nested within each other | |
as dock widgets. | |
""" | |
from random import randint | |
try: |
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
from PySide import QtCore, QtGui | |
class Widget(QtGui.QWidget): | |
def __init__(self): | |
super(Widget, self).__init__() | |
self.resize(300,200) | |
layout = QtGui.QVBoxLayout(self) |
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 inspect | |
def trace(): | |
frames = (str(f[1:4]) for f in inspect.getouterframes(inspect.currentframe())[1:]) | |
print "\n".join(frames) | |
print '\n' |
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
Show hidden characters
// Preferences.sublime-settings | |
{ | |
// ... | |
"auto_complete_triggers": [{"selector": "source.python", "characters": "."}], | |
"auto_complete_selector": "-" | |
} |
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
from PyQt4 import QtCore, QtGui | |
class ColorBox(QtGui.QFrame): | |
def __init__(self,parent=None): | |
super(ColorBox,self).__init__(parent) | |
self.bgColor = QtCore.Qt.white | |
self.setFixedHeight(20) | |
self.setFrameStyle(1) |