visualstudio_ipython_repl.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:pythonVSCode 作者: DonJayamanne 项目源码 文件源码
def __init__(self, mod_name = '__main__', launch_file = None):
        ReplBackend.__init__(self)
        self.launch_file = launch_file
        self.mod_name = mod_name
        self.km = VsKernelManager()

        if is_ipython_versionorgreater(0, 13):
            # http://pytools.codeplex.com/workitem/759
            # IPython stopped accepting the ipython flag and switched to launcher, the new
            # default is what we want though.
            self.km.start_kernel(**{'extra_arguments': self.get_extra_arguments()})
        else:
            self.km.start_kernel(**{'ipython': True, 'extra_arguments': self.get_extra_arguments()})
        self.km.start_channels()
        self.exit_lock = thread.allocate_lock()
        self.exit_lock.acquire()     # used as an event
        self.members_lock = thread.allocate_lock()
        self.members_lock.acquire()

        self.km.shell_channel._vs_backend = self
        self.km.stdin_channel._vs_backend = self
        if is_ipython_versionorgreater(1, 0):
            self.km.iopub_channel._vs_backend = self
        else:
            self.km.sub_channel._vs_backend = self
        self.km.hb_channel._vs_backend = self
        self.execution_count = 1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号