I am trying to write file in remote windows server using network drive concept but failed to find network location:
z = open("\\\\xxxxxxxx\Program Files\abc.txt")
z.write('This is a test\n')
Please suggest me alternative options.
I am trying to write file in remote windows server using network drive concept but failed to find network location:
z = open("\\\\xxxxxxxx\Program Files\abc.txt")
z.write('This is a test\n')
Please suggest me alternative options.
Try with this:
from os import os.path
filename = 'abc.txt'
# use forward slash instead of back slash
path = '//xxxxxxxx/Program Files/'
outputfile = os.path.join(path, filename)
output = open(outputfile, 'w')
Use Paramiko
module in python for create SFTP session then you can transfer or create and write files to remote or remote to local