Last active
September 25, 2019 12:43
-
-
Save dbrrt/24edf7fe7865d79f02a0356c9a8bf368 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from fs.sshfs import SSHFS | |
| host = '192.168.1.10' | |
| remote_path = '/home/jovyan/dev/test-fs-sshfs/requirements.txt' | |
| remote_fs = SSHFS( | |
| host, user='david', passwd='test', pkey=None, timeout=10, port=22, | |
| keepalive=10, compress=False, config_path='~/.ssh/config' | |
| ) | |
| remote_file = remote_fs.openbin(remote_path) | |
| line = remote_file.readline() | |
| while line: | |
| try: | |
| line = line.decode('utf8') | |
| print (line.strip()) | |
| except: | |
| pass | |
| line = remote_file.readline() | |
| remote_file.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment