本文整理汇总了Python中spyderlib.utils.qthelpers.qapplication函数的典型用法代码示例。如果您正苦于以下问题:Python qapplication函数的具体用法?Python qapplication怎么用?Python qapplication使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了qapplication函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test
def test():
"""Array editor test"""
_app = qapplication()
arr = np.array(["kjrekrjkejr"])
print("out:", test_edit(arr, "string array"))
from spyderlib.py3compat import u
arr = np.array([u("kjrekrjkejr")])
print("out:", test_edit(arr, "unicode array"))
arr = np.ma.array([[1, 0], [1, 0]], mask=[[True, False], [False, False]])
print("out:", test_edit(arr, "masked array"))
arr = np.zeros((2, 2), {'names': ('red', 'green', 'blue'),
'formats': (np.float32, np.float32, np.float32)})
print("out:", test_edit(arr, "record array"))
arr = np.array([(0, 0.0), (0, 0.0), (0, 0.0)],
dtype=[(('title 1', 'x'), '|i1'),
(('title 2', 'y'), '>f4')])
print("out:", test_edit(arr, "record array with titles"))
arr = np.random.rand(5, 5)
print("out:", test_edit(arr, "float array",
xlabels=['a', 'b', 'c', 'd', 'e']))
arr = np.round(np.random.rand(5, 5)*10)+\
np.round(np.random.rand(5, 5)*10)*1j
print("out:", test_edit(arr, "complex array",
xlabels=np.linspace(-12, 12, 5),
ylabels=np.linspace(-12, 12, 5)))
arr_in = np.array([True, False, True])
print("in:", arr_in)
arr_out = test_edit(arr_in, "bool array")
print("out:", arr_out)
print(arr_in is arr_out)
arr = np.array([1, 2, 3], dtype="int8")
print("out:", test_edit(arr, "int array"))
示例2: test
def test():
"""Run file/directory explorer test"""
from spyderlib.utils.qthelpers import qapplication
app = qapplication()
test = Test()
test.show()
sys.exit(app.exec_())
示例3: test_widget
def test_widget():
"""Run conda packages widget test"""
from spyderlib.utils.qthelpers import qapplication
app = qapplication()
widget = CondaPackagesWidget(None)
widget.show()
sys.exit(app.exec_())
示例4: oedit
def oedit(obj):
"""
Edit the object 'obj' in a GUI-based editor and return the edited copy
(if Cancel is pressed, return None)
The object 'obj' is a container
Supported container types:
dict, list, tuple, str/unicode or numpy.array
(instantiate a new QApplication if necessary,
so it can be called directly from the interpreter)
"""
# Local import
from spyderlib.widgets.texteditor import TextEditor
from spyderlib.widgets.dicteditor import DictEditor, ndarray, FakeObject
from spyderlib.widgets.arrayeditor import ArrayEditor
from spyderlib.utils.qthelpers import qapplication
_app = qapplication()
if isinstance(obj, ndarray) and ndarray is not FakeObject:
dialog = ArrayEditor()
if dialog.setup_and_check(obj):
if dialog.exec_():
return obj
elif isinstance(obj, (str, unicode)):
dialog = TextEditor(obj)
if dialog.exec_():
return dialog.get_copy()
elif isinstance(obj, (dict, tuple, list)):
dialog = DictEditor(obj)
if dialog.exec_():
return dialog.get_copy()
else:
raise RuntimeError("Unsupported datatype")
示例5: test
def test():
"""Run breakpoint widget test"""
from spyderlib.utils.qthelpers import qapplication
app = qapplication()
widget = BreakpointWidget(None)
widget.show()
sys.exit(app.exec_())
示例6: test
def test():
from spyderlib.utils.qthelpers import qapplication
app = qapplication()
from spyderlib.widgets.externalshell.pythonshell import ExternalPythonShell
from spyderlib.widgets.externalshell.systemshell import ExternalSystemShell
import spyderlib
from spyderlib.plugins.variableexplorer import VariableExplorer
settings = VariableExplorer.get_settings()
shell = ExternalPythonShell(wdir=osp.dirname(spyderlib.__file__),
ipykernel=True, stand_alone=settings,
arguments="-q4thread -pylab -colors LightBG",
light_background=False)
# shell = ExternalPythonShell(wdir=osp.dirname(spyderlib.__file__),
# interact=True, umr_enabled=True,
# stand_alone=settings,
# umr_namelist=['guidata', 'guiqwt'],
# umr_verbose=True, light_background=False)
# shell = ExternalSystemShell(wdir=osp.dirname(spyderlib.__file__),
# light_background=False)
shell.shell.toggle_wrap_mode(True)
shell.start_shell(False)
from spyderlib.qt.QtGui import QFont
font = QFont("Lucida console")
font.setPointSize(10)
shell.shell.set_font(font)
shell.show()
sys.exit(app.exec_())
示例7: test
def test(text):
"""Test"""
from spyderlib.utils.qthelpers import qapplication
_app = qapplication() # analysis:ignore
dialog = ImportWizard(None, text)
if dialog.exec_():
print(dialog.get_data())
示例8: test_dialog
def test_dialog():
"""Run conda packages widget test"""
from spyderlib.utils.qthelpers import qapplication
app = qapplication()
dialog = CondaPackagesDialog(name='root')
dialog.exec_()
sys.exit(app.exec_())
示例9: test
def test():
from spyderlib.utils.qthelpers import qapplication
app = qapplication()
from spyderlib.plugins.variableexplorer import VariableExplorer
settings = VariableExplorer.get_settings()
shell = ExternalPythonShell(
pythonexecutable=sys.executable,
interact=True,
stand_alone=settings,
wdir=osp.dirname(__file__),
mpl_backend=0,
light_background=False,
)
from spyderlib.qt.QtGui import QFont
from spyderlib.config.main import CONF
font = QFont(CONF.get("console", "font/family")[0])
font.setPointSize(10)
shell.shell.set_font(font)
shell.shell.toggle_wrap_mode(True)
shell.start_shell(False)
shell.show()
sys.exit(app.exec_())
示例10: test
def test():
"""Run path manager test"""
from spyderlib.utils.qthelpers import qapplication
_app = qapplication() # analysis:ignore
test = PathManager(None, sys.path[:-10], sys.path[-10:])
test.exec_()
print(test.get_path_list())
示例11: test
def test():
"""Run Find in Files widget test"""
from spyderlib.utils.qthelpers import qapplication
app = qapplication()
widget = FindInFilesWidget(None)
widget.show()
sys.exit(app.exec_())
示例12: test
def test():
from spyderlib.utils.qthelpers import qapplication
app = qapplication()
table = ShortcutsTable()
table.show()
app.exec_()
print [str(s) for s in table.model.shortcuts]
示例13: main
def main():
"""Run Windows environment variable editor"""
from spyderlib.utils.qthelpers import qapplication
app = qapplication()
dialog = WinUserEnvDialog()
dialog.show()
app.exec_()
示例14: test
def test():
"""Run RateLaw widget test"""
from spyderlib.utils.qthelpers import qapplication
app = qapplication()
widget = RateLawWidget(None)
widget.resize(400, 300)
widget.show()
sys.exit(app.exec_())
示例15: main
def main():
"""Run web browser"""
from spyderlib.utils.qthelpers import qapplication
app = qapplication()
widget = PydocBrowser(None)
widget.show()
widget.initialize()
sys.exit(app.exec_())