Skip to content

Instantly share code, notes, and snippets.

import os
from cStringIO import StringIO
try:
import xml.etree.cElementTree as Xml
except ImportError:
import xml.etree.ElementTree as Xml
from PySide import QtGui # noqa
from PySide.QtCore import QFile
from PySide.QtUiTools import QUiLoader
@ross-g
ross-g / pyside_compat.py
Created March 19, 2018 21:13
Maya Pyside import for compatibility across versions
try:
from PySide2 import QtCore, QtGui, QtWidgets
from shiboken2 import wrapInstance
except ImportError:
from PySide import QtCore, QtGui
from PySide import QtGui as QtWidgets
from shiboken import wrapInstance
@ross-g
ross-g / Dos_Command.ms
Last active August 29, 2015 14:26
Using dotNet "System.Diagnostics.Process" for a better DOSCommand in Maxscript.
global Dos_Command
struct DOSCMD (
fn run exe_path arg_array:undefined as_string:false =
(
local process = dotNetObject "System.Diagnostics.Process"
process.StartInfo.UseShellExecute = false
process.StartInfo.RedirectStandardOutput = true
process.StartInfo.RedirectStandardError = true
process.StartInfo.FileName = exe_path