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() |
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
| 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
| 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
| 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
| """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
| import maya.api.OpenMaya as om | |
| import maya.api.OpenMayaUI as omui | |
| import maya.cmds as cmds | |
| # Maya Python API: | |
| # http://help.autodesk.com/view/MAYAUL/2017/ENU/?guid=__py_ref_index_html | |
| def onPress(): | |
| """Take x,y from mouse click, convert into 3d world coordinates""" |
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 maya.cmds as mc | |
| def _null(*args): | |
| pass | |
| class _shelf(): | |
| '''A simple class to build shelves in maya. Since the build method is empty, | |
| it should be extended by the derived class to build the necessary shelf elements. |
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
| #!/usr/bin/python3 | |
| #-*- coding:utf-8 -*- | |
| import csv, codecs | |
| import os | |
| import pandas as pd | |
| from PyQt5 import QtPrintSupport | |
| from PyQt5.QtGui import (QImage, QPainter, QIcon, QKeySequence, QTextCursor, QPalette, | |
| QCursor, QDropEvent, QTextDocument, QTextTableFormat, QColor, QBrush) | |
| from PyQt5.QtCore import (QFile, QSettings, Qt, QFileInfo, QItemSelectionModel, QDir, | |
| QMetaObject, QAbstractTableModel, QModelIndex, QVariant) |
OlderNewer