• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python monitor.communicate函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中spyderlib.widgets.externalshell.monitor.communicate函数的典型用法代码示例。如果您正苦于以下问题:Python communicate函数的具体用法?Python communicate怎么用?Python communicate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了communicate函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: set_autorefresh_timeout

 def set_autorefresh_timeout(self, interval):
     if self.introspection_socket is not None:
         try:
             communicate(self.introspection_socket,
                         "set_monitor_timeout(%d)" % interval)
         except socket.error:
             pass
开发者ID:jromang,项目名称:retina-old,代码行数:7,代码来源:pythonshell.py


示例2: option_changed

 def option_changed(self, option, value):
     """Option has changed"""
     setattr(self, to_text_string(option), value)
     if not self.is_internal_shell:
         settings = self.get_view_settings()
         communicate(self._get_sock(),
                     'set_remote_view_settings()', settings=[settings])
开发者ID:ImadBouirmane,项目名称:spyder,代码行数:7,代码来源:namespacebrowser.py


示例3: get_value

 def get_value(self, name):
     value = monitor_get_global(self._get_sock(), name)
     if value is None:
         if communicate(self._get_sock(), '%s is not None' % name):
             import pickle
             msg = to_text_string(_("Object <b>%s</b> is not picklable")
                                  % name)
             raise pickle.PicklingError(msg)
     return value
开发者ID:ImadBouirmane,项目名称:spyder,代码行数:9,代码来源:namespacebrowser.py


示例4: ask_monitor

 def ask_monitor(self, command, settings=[]):
     sock = self.externalshell.introspection_socket
     if sock is None:
         return
     try:
         return communicate(sock, command, settings=settings)
     except socket.error:
         # Process was just closed            
         pass
     except MemoryError:
         # Happens when monitor is not ready on slow machines
         pass
开发者ID:jromang,项目名称:retina-old,代码行数:12,代码来源:pythonshell.py


示例5: refresh_table

 def refresh_table(self):
     """Refresh variable table"""
     if self.is_visible and self.isVisible():
         if self.is_internal_shell:
             # Internal shell
             wsfilter = self.get_internal_shell_filter('editable')
             self.editor.set_filter(wsfilter)
             interpreter = self.shellwidget.interpreter
             if interpreter is not None:
                 self.editor.set_data(interpreter.namespace)
                 self.editor.adjust_columns()
         elif self.shellwidget.is_running():
 #            import time; print >>STDOUT, time.ctime(time.time()), "Refreshing namespace browser"
             sock = self._get_sock()
             if sock is None:
                 return
             try:
                 communicate(sock, "refresh()")
             except socket.error:
                 # Process was terminated before calling this method
                 pass                
开发者ID:ImadBouirmane,项目名称:spyder,代码行数:21,代码来源:namespacebrowser.py


示例6: send_to_process

    def send_to_process(self, text):
        if not isinstance(text, basestring):
            text = unicode(text)
        if self.install_qt_inputhook and not self.is_ipython_shell:
            # For now, the Spyder's input hook does not work with IPython:
            # with IPython v0.10 or non-Windows platforms, this is not a
            # problem. However, with IPython v0.11 on Windows, this will be
            # fixed by patching IPython to force it to use our inputhook.
            communicate(self.introspection_socket,
                        "toggle_inputhook_flag(True)")
#            # Socket-based alternative (see input hook in sitecustomize.py):
#            while self.local_server.hasPendingConnections():
#                self.local_server.nextPendingConnection().write('go!')
        if not self.is_ipython_shell and text.startswith(('%', '!')):
            text = 'evalsc(r"%s")\n' % text
        if not text.endswith('\n'):
            text += '\n'
        self.process.write(locale_codec.fromUnicode(text))
        self.process.waitForBytesWritten(-1)
        
        # Eventually write prompt faster (when hitting Enter continuously)
        # -- necessary/working on Windows only:
        if os.name == 'nt':
            self.write_error()
开发者ID:jromang,项目名称:retina-old,代码行数:24,代码来源:pythonshell.py


示例7: is_dict

 def is_dict(self, name):
     """Return True if variable is a dictionary"""
     return communicate(self.shellwidget.monitor_socket,
                        "isinstance(globals()['%s'], dict)" % name,
                        pickle_try=True)
开发者ID:cheesinglee,项目名称:spyder,代码行数:5,代码来源:namespacebrowser.py


示例8: is_series

 def is_series(self, name):
     """Return True if variable is a Series"""
     return communicate(self._get_sock(),
          "isinstance(globals()['%s'], Series)" % name)
开发者ID:ChunHungLiu,项目名称:spyder,代码行数:4,代码来源:namespacebrowser.py


示例9: is_data_frame

 def is_data_frame(self, name):
     """Return True if variable is a data_frame"""
     return communicate(self._get_sock(),
          "isinstance(globals()['%s'], DataFrame)" % name)
开发者ID:ImadBouirmane,项目名称:spyder,代码行数:4,代码来源:namespacebrowser.py


示例10: get_array_shape

 def get_array_shape(self, name):
     """Return array's shape"""
     return communicate(self._get_sock(), "%s.shape" % name)
开发者ID:ImadBouirmane,项目名称:spyder,代码行数:3,代码来源:namespacebrowser.py


示例11: is_dict

 def is_dict(self, name):
     """Return True if variable is a dictionary"""
     return communicate(self._get_sock(), 'isinstance(%s, dict)' % name)
开发者ID:ImadBouirmane,项目名称:spyder,代码行数:3,代码来源:namespacebrowser.py


示例12: is_array

 def is_array(self, name):
     """Return True if variable is a NumPy array"""
     return communicate(self._get_sock(), 'is_array("%s")' % name)
开发者ID:ImadBouirmane,项目名称:spyder,代码行数:3,代码来源:namespacebrowser.py


示例13: keyboard_interrupt

 def keyboard_interrupt(self):
     if self.introspection_socket is not None:
         communicate(self.introspection_socket, "thread.interrupt_main()")
开发者ID:jromang,项目名称:retina-old,代码行数:3,代码来源:pythonshell.py


示例14: toggle_auto_refresh

 def toggle_auto_refresh(self, state):
     """Toggle auto refresh state"""
     self.autorefresh = state
     if not self.setup_in_progress and not self.is_internal_shell:
         communicate(self._get_sock(),
                     "set_monitor_auto_refresh(%r)" % state)
开发者ID:ImadBouirmane,项目名称:spyder,代码行数:6,代码来源:namespacebrowser.py


示例15: is_list

 def is_list(self, name):
     """Return True if variable is a list or a tuple"""
     return communicate(self.shellwidget.monitor_socket,
                        "isinstance(globals()['%s'], (tuple, list))" % name,
                        pickle_try=True)
开发者ID:cheesinglee,项目名称:spyder,代码行数:5,代码来源:namespacebrowser.py


示例16: is_tablelist

 def is_tablelist(self, name):
     """Return True if variable is a PeakMap"""
     return communicate(self._get_sock(),
                        "isinstance(globals()['%s'], list) "
                        "and all(isinstance(li, emzed.core.data_types.Table)"
                        "        for li in globals()['%s'])" % (name, name))
开发者ID:gmat,项目名称:emzed2,代码行数:6,代码来源:patches.py


示例17: is_table

 def is_table(self, name):
     """Return True if variable is a PeakMap"""
     return communicate(self._get_sock(),
                        "isinstance(globals()['%s'], emzed.core.data_types.Table)" % name)
开发者ID:gmat,项目名称:emzed2,代码行数:4,代码来源:patches.py


示例18: get_len

 def get_len(self, name):
     """Return sequence length"""
     return communicate(self.shellwidget.monitor_socket,
                        "len(globals()['%s'])" % name,
                        pickle_try=True)
开发者ID:cheesinglee,项目名称:spyder,代码行数:5,代码来源:namespacebrowser.py


示例19: get_array_ndim

 def get_array_ndim(self, name):
     """Return array's ndim"""
     return communicate(self.shellwidget.monitor_socket,
                        "globals()['%s'].ndim" % name,
                        pickle_try=True)
开发者ID:cheesinglee,项目名称:spyder,代码行数:5,代码来源:namespacebrowser.py


示例20: is_list

 def is_list(self, name):
     """Return True if variable is a list or a tuple"""
     return communicate(self._get_sock(),
                        'isinstance(%s, (tuple, list))' % name)
开发者ID:ImadBouirmane,项目名称:spyder,代码行数:4,代码来源:namespacebrowser.py



注:本文中的spyderlib.widgets.externalshell.monitor.communicate函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python findreplace.FindReplace类代码示例发布时间:2022-05-27
下一篇:
Python baseshell.ExternalShellBase类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap