本文整理汇总了Python中spyderlib.utils.qthelpers.qapplication函数的典型用法代码示例。如果您正苦于以下问题:Python qapplication函数的具体用法?Python qapplication怎么用?Python qapplication使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了qapplication函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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"))
开发者ID:alfonsodiecko,项目名称:PYTHON_DIST,代码行数:33,代码来源:arrayeditor.py
示例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_())
开发者ID:cheesinglee,项目名称:spyder,代码行数:7,代码来源:explorer.py
示例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_())
开发者ID:ccordoba12,项目名称:conda-manager,代码行数:7,代码来源:packages.py
示例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")
开发者ID:cheesinglee,项目名称:spyder,代码行数:35,代码来源:objecteditor.py
示例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_())
开发者ID:AminJamalzadeh,项目名称:spyder,代码行数:7,代码来源:breakpointsgui.py
示例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_())
开发者ID:ymarfoq,项目名称:outilACVDesagregation,代码行数:27,代码来源:baseshell.py
示例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())
开发者ID:dhirschfeld,项目名称:spyderlib,代码行数:7,代码来源:importwizard.py
示例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_())
开发者ID:ccordoba12,项目名称:conda-manager,代码行数:7,代码来源:packages.py
示例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_())
开发者ID:MarvinLiu0810,项目名称:spyder,代码行数:29,代码来源:pythonshell.py
示例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())
开发者ID:jromang,项目名称:spyderlib,代码行数:7,代码来源:pathmanager.py
示例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_())
开发者ID:Micseb,项目名称:spyder,代码行数:7,代码来源:findinfiles.py
示例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]
开发者ID:jromang,项目名称:retina-old,代码行数:7,代码来源:shortcuts.py
示例13: main
def main():
"""Run Windows environment variable editor"""
from spyderlib.utils.qthelpers import qapplication
app = qapplication()
dialog = WinUserEnvDialog()
dialog.show()
app.exec_()
开发者ID:jromang,项目名称:retina-old,代码行数:7,代码来源:environ.py
示例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_())
开发者ID:jayitb,项目名称:Spyderplugin_ratelaws,代码行数:8,代码来源:ratelawgui.py
示例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_())
开发者ID:jromang,项目名称:spyderlib,代码行数:8,代码来源:pydocgui.py
示例16: test
def test(): # pragma: no cover
from spyderlib.utils.qthelpers import qapplication
app = qapplication()
dlg_table = NumpyArrayDialog(None, inline=False)
dlg_inline = NumpyArrayDialog(None, inline=True)
dlg_table.show()
dlg_inline.show()
app.exec_()
开发者ID:DLlearn,项目名称:spyder,代码行数:8,代码来源:arraybuilder.py
示例17: test
def test():
"""Run pylint widget test"""
from spyderlib.utils.qthelpers import qapplication
app = qapplication()
widget = PylintWidget(None)
widget.show()
widget.analyze(__file__)
sys.exit(app.exec_())
开发者ID:dhirschfeld,项目名称:spyderlib,代码行数:8,代码来源:pylintgui.py
示例18: test
def test():
"""Run widget test"""
from spyderlib.utils.qthelpers import qapplication
app = qapplication()
widget = ProfilerWidget(None)
widget.show()
#widget.analyze(__file__)
widget.analyze('/var/tmp/test001.py')
sys.exit(app.exec_())
开发者ID:sjara,项目名称:spyder-profiler,代码行数:9,代码来源:profilergui.py
示例19: test
def test():
"""Run web browser"""
from spyderlib.utils.qthelpers import qapplication
app = qapplication(test_time=8)
widget = WebBrowser()
widget.show()
widget.set_home_url('http://www.google.com/')
widget.go_home()
sys.exit(app.exec_())
开发者ID:DLlearn,项目名称:spyder,代码行数:9,代码来源:browser.py
示例20: main
def main():
"""Run web browser"""
from spyderlib.utils.qthelpers import qapplication
app = qapplication()
widget = WebBrowser()
widget.show()
widget.set_home_url('http://localhost:7464/')
widget.go_home()
sys.exit(app.exec_())
开发者ID:CVML,项目名称:spyder,代码行数:9,代码来源:browser.py
注:本文中的spyderlib.utils.qthelpers.qapplication函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论