문제

Is there an abstraction that will allow me to connect to a samba share in python regardless of my platform?

More information

I do not want to mount a share. I simply want to upload files to a share, such as smbclient's put.

Thanks, Pete

도움이 되었습니까?

해결책

pysmb seems to do this: https://miketeo.net/wp/index.php/projects/pysmb (edited with new link)

다른 팁

As per this question, I would use subprocess to execute a mount command in Unix-y systems (most all of them save windows) -- and mountvol on windows, which that SO question doesn't mention. It's a tiny difference in the string to pass to subprocess, easy to encapsulate in a tiny function, which may be the reason I don't think there's any "third party solution" to this issue -- it's just too small an issue;-).

If you don't want to mount the filesystem, nosklo (a frequent SO poster) has made available a package to access the filesystem directly, but I haven't tried that.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top