本文整理汇总了Python中spyderlib.utils.programs.is_module_installed函数的典型用法代码示例。如果您正苦于以下问题:Python is_module_installed函数的具体用法?Python is_module_installed怎么用?Python is_module_installed使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_module_installed函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: is_qtconsole_installed
def is_qtconsole_installed():
pyzmq_installed = programs.is_module_installed("zmq")
pygments_installed = programs.is_module_installed("pygments")
if programs.is_module_installed("IPython.qt") and pyzmq_installed and pygments_installed:
return True
else:
return False
开发者ID:ymarfoq,项目名称:outilACVDesagregation,代码行数:7,代码来源:ipythonconfig.py
示例2: is_qtconsole_installed
def is_qtconsole_installed():
if programs.is_module_installed('IPython.qt'):
return True
elif programs.is_module_installed('IPython.frontend.qt'):
return True
else:
return False
开发者ID:dhirschfeld,项目名称:spyderlib,代码行数:7,代码来源:ipythonconfig.py
示例3: show_banner
def show_banner(self):
"""Banner for IPython widgets with pylab message"""
from IPython.core.usage import default_gui_banner
banner = default_gui_banner
pylab_o = CONF.get('ipython_console', 'pylab', True)
autoload_pylab_o = CONF.get('ipython_console', 'pylab/autoload', True)
mpl_installed = programs.is_module_installed('matplotlib')
if mpl_installed and (pylab_o and autoload_pylab_o):
backend_o = CONF.get('ipython_console', 'pylab/backend', 0)
backends = {0: 'module://IPython.zmq.pylab.backend_inline',
1: 'Qt4Agg', 2: 'Qt4Agg', 3: 'MacOSX', 4: 'GTKAgg',
5: 'WXAgg', 6: 'TKAgg'}
pylab_013_message = """
Welcome to pylab, a matplotlib-based Python environment [backend: %s].
For more information, type 'help(pylab)'.\n""" % backends[backend_o]
pylab_1_message = """
Populating the interactive namespace from numpy and matplotlib"""
if programs.is_module_installed('IPython', '>=1.0'):
banner = banner + pylab_1_message
else:
banner = banner + pylab_013_message
sympy_o = CONF.get('ipython_console', 'symbolic_math', True)
if sympy_o:
lines = """
These commands were executed:
>>> from __future__ import division
>>> from sympy import *
>>> x, y, z, t = symbols('x y z t')
>>> k, m, n = symbols('k m n', integer=True)
>>> f, g, h = symbols('f g h', cls=Function)
"""
banner = banner + lines
return banner
开发者ID:jromang,项目名称:spyderlib,代码行数:35,代码来源:ipython.py
示例4: sympy_config
def sympy_config():
"""Sympy configuration"""
from spyderlib.utils.programs import is_module_installed
lines_new = """
from sympy.interactive import init_session
init_session()
"""
lines_old = """
from __future__ import division
from sympy import *
x, y, z, t = symbols('x y z t')
k, m, n = symbols('k m n', integer=True)
f, g, h = symbols('f g h', cls=Function)
"""
if is_module_installed('sympy', '>=0.7.3'):
extension = None
return lines_new, extension
elif is_module_installed('sympy', '=0.7.2'):
extension = 'sympy.interactive.ipythonprinting'
return lines_old, extension
elif is_module_installed('sympy', '>=0.7.0;<0.7.2'):
extension = 'sympyprinting'
return lines_old, extension
else:
return None, None
开发者ID:dhirschfeld,项目名称:spyderlib,代码行数:25,代码来源:start_ipython_kernel.py
示例5: is_qtconsole_installed
def is_qtconsole_installed():
pyzmq_installed = programs.is_module_installed('zmq', version=ZMQ_REQVER)
pygments_installed = programs.is_module_installed('pygments')
if programs.is_module_installed('IPython.qt') and pyzmq_installed \
and pygments_installed:
return True
else:
return False
开发者ID:pxwish,项目名称:spyder,代码行数:8,代码来源:ipythonconfig.py
示例6: is_qtconsole_installed
def is_qtconsole_installed():
pyzmq_installed = programs.is_module_installed('zmq', version=ZMQ_REQVER)
pygments_installed = programs.is_module_installed('pygments')
qtconsole_installed = programs.is_module_installed('qtconsole',
version=QTCONSOLE_REQVER)
if pyzmq_installed and pygments_installed and qtconsole_installed:
return True
else:
return False
开发者ID:AminJamalzadeh,项目名称:spyder,代码行数:10,代码来源:ipython.py
示例7: load_plugin
def load_plugin(self):
"""Load the Jedi introspection plugin"""
if not programs.is_module_installed('jedi', JEDI_REQVER):
raise ImportError('Requires Jedi %s' % JEDI_REQVER)
jedi.settings.case_insensitive_completion = False
for lib in ['numpy', 'matplotlib']:
jedi.preload_module(lib)
开发者ID:AminJamalzadeh,项目名称:spyder,代码行数:7,代码来源:jedi_plugin.py
示例8: import_test
def import_test(self):
"""Raise ImportError if feature is not supported"""
from spyderlib.utils import programs
if not programs.is_module_installed('psutil', '>=0.2.0'):
# The `interval` argument in `psutil.cpu_percent` function
# was introduced in v0.2.0
raise ImportError
开发者ID:ImadBouirmane,项目名称:spyder,代码行数:7,代码来源:status.py
示例9: long_banner
def long_banner(self):
"""Banner for IPython widgets with pylab message"""
from IPython.core.usage import default_gui_banner
banner = default_gui_banner
pylab_o = CONF.get('ipython_console', 'pylab', True)
autoload_pylab_o = CONF.get('ipython_console', 'pylab/autoload', True)
mpl_installed = programs.is_module_installed('matplotlib')
if mpl_installed and (pylab_o and autoload_pylab_o):
pylab_message = ("\nPopulating the interactive namespace from "
"numpy and matplotlib")
banner = banner + pylab_message
sympy_o = CONF.get('ipython_console', 'symbolic_math', True)
if sympy_o:
lines = """
These commands were executed:
>>> from __future__ import division
>>> from sympy import *
>>> x, y, z, t = symbols('x y z t')
>>> k, m, n = symbols('k m n', integer=True)
>>> f, g, h = symbols('f g h', cls=Function)
"""
banner = banner + lines
return banner
开发者ID:MarvinLiu0810,项目名称:spyder,代码行数:25,代码来源:ipython.py
示例10: is_qtconsole_installed
def is_qtconsole_installed():
ipyqt_installed = programs.is_module_installed('IPython.qt',
version=IPYTHON_REQVER)
pyzmq_installed = programs.is_module_installed('zmq', version=ZMQ_REQVER)
pygments_installed = programs.is_module_installed('pygments')
if ipyqt_installed and pyzmq_installed and pygments_installed:
if ipy4_installed:
if programs.is_module_installed('qtconsole'):
return True
else:
return False
else:
return True
else:
return False
开发者ID:MarvinLiu0810,项目名称:spyder,代码行数:16,代码来源:ipython.py
示例11: open_interpreter_at_startup
def open_interpreter_at_startup(self):
"""Open an interpreter at startup, IPython if module is available"""
if CONF.get(self.ID, 'open_ipython_at_startup') \
and programs.is_module_installed("IPython"):
self.open_ipython()
if CONF.get(self.ID, 'open_python_at_startup'):
self.open_interpreter()
开发者ID:cheesinglee,项目名称:spyder,代码行数:7,代码来源:externalconsole.py
示例12: load_plugin
def load_plugin(self):
"""Load the Jedi introspection plugin"""
if not programs.is_module_installed('jedi', JEDI_REQVER):
raise ImportError('Requires Jedi %s' % JEDI_REQVER)
jedi.settings.case_insensitive_completion = False
self.busy = True
self._warmup_thread = threading.Thread(target=self.preload)
self._warmup_thread.start()
开发者ID:ImadBouirmane,项目名称:spyder,代码行数:8,代码来源:jedi_plugin.py
示例13: load_plugin
def load_plugin(self):
"""Load the Rope introspection plugin"""
if not programs.is_module_installed('rope', ROPE_REQVER):
raise ImportError('Requires Rope %s' % ROPE_REQVER)
self.project = None
self.create_rope_project(root_path=get_conf_path())
submods = get_preferred_submodules()
if self.project is not None:
self.project.prefs.set('extension_modules', submods)
开发者ID:AungWinnHtut,项目名称:spyder,代码行数:9,代码来源:rope_plugin.py
示例14: setup_page
def setup_page(self):
ar_group = QGroupBox(_("Autorefresh"))
ar_box = self.create_checkbox(_("Enable autorefresh"),
'autorefresh')
ar_spin = self.create_spinbox(_("Refresh interval: "),
_(" ms"), 'autorefresh/timeout',
min_=100, max_=1000000, step=100)
filter_group = QGroupBox(_("Filter"))
filter_data = [
('exclude_private', _("Exclude private references")),
('exclude_capitalized', _("Exclude capitalized references")),
('exclude_uppercase', _("Exclude all-uppercase references")),
('exclude_unsupported', _("Exclude unsupported data types")),
]
filter_boxes = [self.create_checkbox(text, option)
for option, text in filter_data]
display_group = QGroupBox(_("Display"))
display_data = [
('truncate', _("Truncate values"), ''),
('inplace', _("Always edit in-place"), ''),
('collvalue', _("Show collection contents"), ''),
]
if programs.is_module_installed('numpy'):
display_data.append(('minmax', _("Show arrays min/max"), ''))
display_data.append(
('remote_editing', _("Edit data in the remote process"),
_("Editors are opened in the remote process for NumPy "
"arrays, PIL images, lists, tuples and dictionaries.\n"
"This avoids transfering large amount of data between "
"the remote process and Spyder (through the socket)."))
)
display_boxes = [self.create_checkbox(text, option, tip=tip)
for option, text, tip in display_data]
ar_layout = QVBoxLayout()
ar_layout.addWidget(ar_box)
ar_layout.addWidget(ar_spin)
ar_group.setLayout(ar_layout)
filter_layout = QVBoxLayout()
for box in filter_boxes:
filter_layout.addWidget(box)
filter_group.setLayout(filter_layout)
display_layout = QVBoxLayout()
for box in display_boxes:
display_layout.addWidget(box)
display_group.setLayout(display_layout)
vlayout = QVBoxLayout()
vlayout.addWidget(ar_group)
vlayout.addWidget(filter_group)
vlayout.addWidget(display_group)
vlayout.addStretch(1)
self.setLayout(vlayout)
开发者ID:jromang,项目名称:retina-old,代码行数:57,代码来源:variableexplorer.py
示例15: write_to_stdin
def write_to_stdin(self, line):
"""
Send raw characters to the IPython kernel through stdin
but only if the kernel is currently looking for raw input.
"""
if self._reading:
if programs.is_module_installed('IPython', '>=1.0'):
self.kernel_client.stdin_channel.input(line)
else:
self.kernel_manager.stdin_channel.input(line)
开发者ID:jromang,项目名称:spyderlib,代码行数:10,代码来源:ipython.py
示例16: kernel_and_frontend_match
def kernel_and_frontend_match(self, connection_file):
# Determine kernel version
ci = get_connection_info(connection_file, unpack=True,
profile='default')
if u('control_port') in ci:
kernel_ver = '>=1.0'
else:
kernel_ver = '<1.0'
# is_module_installed checks if frontend version agrees with the
# kernel one
return programs.is_module_installed('IPython', version=kernel_ver)
开发者ID:Poneyo,项目名称:spyderlib,代码行数:11,代码来源:ipythonconsole.py
示例17: create_module_bookmark_actions
def create_module_bookmark_actions(parent, bookmarks):
"""
Create bookmark actions depending on module installation:
bookmarks = ((module_name, url, title), ...)
"""
actions = []
for key, url, title, icon in bookmarks:
if programs.is_module_installed(key):
act = create_bookmark_action(parent, url, title, get_icon(icon))
actions.append(act)
return actions
开发者ID:cheesinglee,项目名称:spyder,代码行数:11,代码来源:qthelpers.py
示例18: closeEvent
def closeEvent(self, event):
"""
Reimplement Qt method to stop sending the custom_restart_kernel_died
signal
"""
if programs.is_module_installed('IPython', '>=1.0'):
kc = self.shellwidget.kernel_client
if kc is not None:
kc.hb_channel.pause()
else:
self.shellwidget.custom_restart = False
开发者ID:jromang,项目名称:spyderlib,代码行数:11,代码来源:ipython.py
示例19: create_kernel_manager_and_client
def create_kernel_manager_and_client(self, connection_file=None):
"""Create kernel manager and client"""
cf = find_connection_file(connection_file, profile='default')
kernel_manager = QtKernelManager(connection_file=cf, config=None)
if programs.is_module_installed('IPython', '>=1.0'):
kernel_client = kernel_manager.client()
kernel_client.load_connection_file()
kernel_client.start_channels()
# To rely on kernel's heartbeat to know when a kernel has died
kernel_client.hb_channel.unpause()
else:
kernel_client = None
kernel_manager.load_connection_file()
kernel_manager.start_channels()
return kernel_manager, kernel_client
开发者ID:alfonsodiecko,项目名称:PYTHON_DIST,代码行数:15,代码来源:ipythonconsole.py
示例20: get_default_ipython_options
def get_default_ipython_options(self):
"""Return default ipython command line arguments"""
default_options = []
if programs.is_module_installed('matplotlib'):
default_options.append("-pylab")
else:
default_options.append("-q4thread")
default_options.append("-colors LightBG")
default_options.append("-xmode Plain")
for editor_name in ("scite", "gedit"):
real_name = programs.get_nt_program_name(editor_name)
if programs.is_program_installed(real_name):
default_options.append("-editor "+real_name)
break
return " ".join(default_options)
开发者ID:cheesinglee,项目名称:spyder,代码行数:15,代码来源:externalconsole.py
注:本文中的spyderlib.utils.programs.is_module_installed函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论