How to connect to shared folder and access files from it using python


Joined
Jun 25, 2020
Messages
1
Reaction score
0
I am trying to connect share folder using python not able to connect

from pathlib import Path
data_folder = Path("//xx.xx.xx.xx//d$//ftpAutoLogin//jflow-data-files-poc")
file_to_open = data_folder / "mscreen_gxml20200522-143205-512.xml"
f = open(file_to_open)
print(f.read())

I am getting below error
Traceback (most recent call last):
File "/Users/sam1546/Documents/jflow_ebm_data_extraction/ebm_extractor_sharepath.py", line 19, in <module>
f = open(file_to_open)
FileNotFoundError: [Errno 2] No such file or directory: '//xx.xx.xx.xx/d$/ftpAutoLogin/jflow-data-files-poc/mscreen_gxml20200522-143205-512.xml'

Process finished with exit code 1
 
Ad

Advertisements

Joined
Nov 27, 2019
Messages
163
Reaction score
24
This tells you the error:
"FileNotFoundError: [Errno 2] No such file or directory: '//xx.xx.xx.xx/d$/ftpAutoLogin/jflow-data-files-poc/mscreen_gxml20200522-143205-512.xml'"

Check your path to file. ALSO I see "ftp " in the address, FTP does not open anything, it is designed to transfer files. You might want to check the python ftp library for handling this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top