Also should get syntax error on line 1 as missing
Import statement should be on top of code.
Here a working test for upload with
:
.Import statement should be on top of code.
Here a working test for upload with
scp
from Windows to our Linux server.import subprocess import os def file_transfer(fpath, tbl): fname = os.path.join(fpath, tbl) landing_path = "[email protected]:/var/www/python-forum.io/images/tips" subprocess.run(['scp', '-P', '2xxx', fname, landing_path]) if __name__ == "__main__": # On server from Win to Linux Path is like this # G:\1_bilder\logo\speed.png fpath = "/G/1_bilder/logo/" tbl = "speed.png" file_transfer(fpath, tbl)