This file contains hidden or 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
| """Illustration of how to retrieve the shape under the mouse cursor | |
| Usage: | |
| Run `start()` to start listening for when the mouse stops and to display a tooltip | |
| Run `stop()` to stop listening | |
| """ | |
| from maya import cmds | |
| from PySide import QtGui, QtCore |
This file contains hidden or 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
| package main | |
| import ( | |
| "os" | |
| "os/exec" | |
| ) | |
| func Command(args ...string) { | |
| cmd := exec.Command(args[0], args[1:]...) | |
| cmd.Stdin, cmd.Stdout, cmd.Stderr = os.Stdin, os.Stdout, os.Stderr |
This file contains hidden or 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 PySide.QtCore as QtCore | |
| import PySide.QtGui as QtGui | |
| from nukescripts import panels | |
| class PanelTest(QtGui.QWidget): | |
| def __init__(self, parent=None): | |
| QtGui.QWidget.__init__(self, parent) | |
| self.setLayout(QtGui.QVBoxLayout()) | |
| self.myTable = QtGui.QTableWidget() | |
| self.myTable.header = ['Date', 'Files', 'Size', 'Path' ] |
This file contains hidden or 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 __future__ import print_function | |
| from collections import namedtuple | |
| from maya import cmds | |
| import pymel.core as pmc | |
| from maya.utils import executeDeferred | |
| from functools import wraps | |
| KeySequence = namedtuple('KeySequence', 'ctrl shift alt key full') |
This file contains hidden or 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 | |
| import maya.cmds as cmds | |
| import maya.OpenMayaUI as mui | |
| import sip | |
| class MyDialog(QtGui.QDialog): |
This file contains hidden or 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
| #Snippet for getting the default gateway on Linux | |
| #No dependencies beyond Python stdlib | |
| import socket, struct | |
| def get_default_gateway_linux(): | |
| """Read the default gateway directly from /proc.""" | |
| with open("/proc/net/route") as fh: | |
| for line in fh: | |
| fields = line.strip().split() |
NewerOlder