title: Turn a python windows path into a regular path for JSON
body: <p>I want to turn \\\\Network Share\\Folder\\Folder\\File.jpg into a regular path - \\Network Share\Folder\Folder\File.jpg - for a JSON string that I am passing to JavaScript. My code is:</p>
  <pre><code>def searchFile(fileName):
      for entry in os.scandir(folderToSearch):
          if fileName.upper() in entry.path.upper():
              if entry.is_file():
                  return entry.path
  </code></pre>
  <p>Which is returning with the extra backslashes. When I read the JSON data in JavaScript, it cannot find the file due to the extra backslashes. How do I transfer the data from Python to JavaScript?</p>
  <p>I am using the eel library.</p>
  <p><strong>EDIT</strong></p>
  <p>This is how I am creating my JSON data to pass to JavaScript:</p>
  <pre><code>def createUserJSON():
      UserData = {}
      JSONData = []
      UserData['fullName'] = &quot;Test User&quot;
      UserData['email'] = &quot;Test.User@test.com&quot;
      UserData['userImage'] = searchFile(&quot;TestUser&quot;)
      json_data = json.dumps(UserData)
      JSONData.append(json_data)
      return JSONData
  </code></pre>
  <p>This then returns:</p>
  <pre><code>['{&quot;fullName&quot;: &quot;Test User&quot;, &quot;email&quot;: &quot;Test.User@test.com&quot;, &quot;userImage&quot;: &quot;\\\\Network Share\\Folder\\Folder\\File.jpg&quot;}']
  </code></pre>