Python Forum
file transfer via python SFTP SCP
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
file transfer via python SFTP SCP
#1
Hi Team,

I am transfering csv files to cloud via SFTM transfer.
below code is works when i use subprocess.Popen


but doesnt work if i use run command.
subprocess.run(['scp',fname,landing_path])

i am using windows.

def File_transfer(fpath,tbl)

	
	import subprocess
	import os
	
	fname = os.path.join(fpath,tbl)
	landing_path = '"I:\\Test_cloud.txt",[email protected]://disk4//app/landing'	
	subprocess.Popen(['scp',fname,landing_path])


	

if __name__ == "__main__":
	fpath = "D:\\Reports"
	tbl = "Table1.zip"
Yoriz write Sep-10-2022, 06:42 AM:
Please post all code, output and errors (in their entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Reply


Messages In This Thread
file transfer via python SFTP SCP - by mg24 - Sep-10-2022, 04:36 AM
RE: file transfer via python SFTP SCP - by snippsat - Sep-10-2022, 10:44 AM
RE: file transfer via python SFTP SCP - by mg24 - Sep-15-2022, 04:20 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python editor that will SFTP automatically on save sawtooth500 1 272 Apr-30-2024, 05:13 AM
Last Post: Gribouillis
  no such file or directory in SFTP saisankalpj 2 1,607 Nov-25-2022, 11:07 AM
Last Post: DeaD_EyE
  python transfer Sql table to csv using BCP mg24 2 1,420 Oct-04-2022, 06:54 AM
Last Post: mg24
  Multithreaded file transfer from multiple volumes skoobi 2 1,173 Jul-28-2022, 07:52 AM
Last Post: skoobi
Question resume file transfer onran 0 1,673 Jan-27-2021, 02:16 PM
Last Post: onran
  Remote File Transfer- Error wonderboy 1 1,706 Jan-06-2021, 11:24 AM
Last Post: wonderboy
  code to read files in folders and transfer the file name, type, date created to excel Divya577 0 1,886 Dec-06-2020, 04:14 PM
Last Post: Divya577
  DNP3 file transfer with python Aussie 0 1,479 Sep-01-2020, 10:45 PM
Last Post: Aussie
  Splitting the audio file into smaller packets before transfer using UDP protocol in p MuhammadAli152 0 3,752 May-15-2020, 03:01 PM
Last Post: MuhammadAli152
  Opening CSV file from SFTP server not working cluelessintern 0 2,803 Apr-08-2020, 08:10 PM
Last Post: cluelessintern

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020