Any ideas why this will not join properly in Python 2.6 Win?
import os
myPath = "\\\\192.168.1.50\\Shared"
myPath2 = "\\Folder2"
myFile = "1.txt"
print os.path.join(myPath, myPath2, myFile)
Result:
\Folder2\1.txt
I was expecting the result to be “\\192.168.1.50\Shared\Folder2\1.txt” !
Join is a convenience function, it is not too intelligent. For example, it does not verify existence of paths, etc. It just follows some formal rules.
As of your question, remove extra slash in
myPath2definition.gives
\\192.168.1.50\Shared\Folder2\1.txtYou will have same problem with ordinary paths:
gives
\Folder2\1.txt