title: Accessing a windows shared folder from Linux using Python
body: <p>I've a shared folder created (with access to everyone) in Windows. on <code>C:\sharedfolder</code>, so I can access it with:</p>
  
  <pre><code>\\mylocalnetworkip\sharedfolder
  </code></pre>
  
  <p>Now I want a Python script to write stuff there from another machine.</p>
  
  <p>If I run this simple script on Windows (from my machine, using Python under Windows), it works. It creates the file and writes that content.</p>
  
  <pre><code>file = open(r'\\mylocalnetworkip\sharedfolder\tester.dat', 'w')
  file.write('whatever')
  file.close()
  </code></pre>
  
  <p>But if I run the same script in Linux (from another machine, but still on my local network, this means if I ping my IP it works), it doesn't work.</p>
  
  <p>With <em>it doesn't work</em> I mean that <em>it doesn't fail</em>, the strange thing that it creates a file on the same path with the name of the entire </p>
  
  <pre><code>root@mc:/tmp# python tester.py  &lt;-- the script with the code above
  root@mc:/tmp# ls
  \\mylocalnetworkip\sharedfolder\tester.dat  tester.py
  root@mc:/tmp# cat \\mylocalnetworkip\sharedfolder\tester.dat
  whatever
  root@mc:/tmp#
  </code></pre>
  
  <p>Can someone give me a hand and tell me how can I make it work in Linux? Thank you!</p>
  
  <p><strong>PS:</strong> I also tested it using <code>'\\\\mylocalnetworkip\\sharedfolder\\tester.dat'</code> with no luck.</p>