##// END OF EJS Templates
don't require .py extension in %run or command-line...
don't require .py extension in %run or command-line There was an artificial requirement that files must have a '.py' extension to be run. This didn't seem to have any reason, and removing it changed no behavior. extensionless files are interpreted as pure-Python.

File last commit:

r4149:272e128d
r4188:3c385ef8
Show More
qt_for_kernel.py
12 lines | 385 B | text/x-python | PythonLexer
""" Import Qt in a manner suitable for an IPython kernel.
"""
import sys
# Older versions of matplotlib do not support PyQt4 v2 APIs or PySide, so we
# cannot go through the preferred mechanism.
matplotlib = sys.modules.get('matplotlib')
if matplotlib and matplotlib.__version__ <= '1.0.1':
from PyQt4 import QtCore, QtGui
else:
from IPython.external.qt import QtCore, QtGui