Skip to content

Instantly share code, notes, and snippets.

@nicelifeBS
nicelifeBS / timer.py
Created March 28, 2018 05:33 — forked from bradmontgomery/LICENSE.txt
A python decorator that logs execution time.
from functools import wraps
import logging
logger = logging.getLogger(__name__)
def timed(func):
"""This decorator prints the execution time for the decorated function."""
@wraps(func)
def wrapper(*args, **kwargs):
start = time.time()
@nicelifeBS
nicelifeBS / README.md
Created December 19, 2017 20:11 — forked from mottosso/README.md
Minimal QML SceneGraph

untitled

Usage

python main.py --amount 100
  • Panning by left-click + drag
  • Scale by rotating the mouse wheel
import sip
sip.setapi('QString', 2)
sip.setapi('QVariant', 2)
from PyQt4 import QtCore, QtGui
class TableModel(QtCore.QAbstractTableModel):
"""
A simple 5x4 table model to demonstrate the delegates
@nicelifeBS
nicelifeBS / meshSelListener.py
Created February 27, 2016 06:32 — forked from boredstiff/meshSelListener.py
meshSelListener.py
#python
import lx
import lxu.object
import lxu.command
import lxifc
class AwSelListener(lxifc.SelectionListener):
running = False
# python
""" Short snippet demonstrating how you can edit scene item's name using MODO 701 Python API.
"""
import lx
import lxu.select
PREFIX = 'prefix_'
# python
""" Snippet demonstrates how to filter item selection out so it contains
only items of required type (group items in this case).
Filtered items are printed out in Event Log.
"""
import lx
import lxu.select