小编Gan*_*ore的帖子

Vscode:通过集成终端使用 Remote-SSH 在本地打开文件

我正在使用 Remote-SSH 插件进行远程开发,并希望使用集成终端(正在运行远程 shell)在现有编辑器中打开文件。类似的问题已发布在 fit 存储库上,但现在似乎不起作用。

https://github.com/microsoft/vscode-remote-release/issues/766

本地计算机 1.41.1 26076a4de974ead31f97692a0d32f90d735645c0 Windowsx64

远程机器 1.41.0 9579eda04fdb3a9bba2750f15193e5fafe16b959 CentOsx64

你能帮我调试一下吗

remote-server visual-studio-code vscode-remote

5
推荐指数
1
解决办法
3267
查看次数

如何在不检查标志的情况下终止Python线程

class My_Thread(threading.Thread):

    def __init__(self):
        threading.Thread.__init__(self)

    def run(self):
        print "Starting " + self.name
        cmd = [ "bash", 'process.sh']
        p = subprocess.Popen(cmd,
                     stdout=subprocess.PIPE,
                     stderr=subprocess.STDOUT)
        for line in iter(p.stdout.readline, b''):
            print ("-- " + line.rstrip())
        print "Exiting " + self.name

    def stop(self):
        print "Trying to stop thread "
        self.run = False

thr = My_Thread()
thr.start()
time.sleep(30)
thr.stop()
thr.join()
Run Code Online (Sandbox Code Playgroud)

所以我有如上所示的线程,实际上在windows上工作,process.sh是在cygwin中运行的bash脚本,需要大约5分钟才能完成执行所以它不是一个循环它的一些模拟proecess

我想在这个类中创建stop()函数,以便我可以在需要时立即终止脚本.终止后,我不希望process.sh脚本有任何有用的结果

请你建议任何方法,如果可能的话请给出一点解释..

python multithreading subprocess python-multithreading python-2.7

4
推荐指数
2
解决办法
3万
查看次数