By using VSCode (Visual Studio Code) I execute Python code on a local Python (Anaconda) interpreter. Now I would like to set it up so that I am able to execute that code on a remote Python interpreter.
I have a Linux device which has its own Python and is accessible via ssh.
Is it possible to configure it? If so how?
Thank you.
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
While Microsoft is working on officially implementing this in VSCode (see: https://github.com/Microsoft/vscode-python/issues/79) I am personally using the following task defined in
tasks.json
for running Python on my remote machine. It contains two tasks: (1) synchronize the code to the remote machine using rsync; (2) execute the code over SSH in the remote interpreter. Note that the execution taskdependsOn
the sync task so that executing the code is always done from the latest local copy.Note that you can also assign a keybinding to executing the task so that you can execute the Python code on the remote with a single keypress. Add to
keybindings.json
: