title: How to make a python script run on client side in node js?
body: <p>I am working on a node js application that will serve as an interface to some network shared documents.</p>
  <p><strong>One functionality is that a client should be able to click a button on the website and be redirected to a network shared path.</strong><br />
  To do this, I had to make a python script that opens that path because the browser is not allowed to open other files than the project's.</p>
  <p>But now when it came to the deployment of the app I realised that the script I mentioned above will always open that folder path on the hosting pc.
  How can I get around this?
  Like running script on client side (if possible).</p>
  <p>And also the server is currently hosted on my pc, and I guess that others connected to the same network have access to it. Is there an more efficient way in which others can see my website? I would like some tips on deployment/ or a method to make my local server visible to the client from their perspective. (&quot;from their perspective&quot; - currently if I give someone the ip address they will be able to see the website but it's acting like I'm seeing it from another monitor. All the things still happen on the host pc, not the client's).</p>
  <p>This is the python script that opens that path:</p>
  <pre><code>import webbrowser
  import sys
  webbrowser.open(sys.argv[1])
  </code></pre>
  <p>This is the post method to run the script when someone is pressing that button:</p>
  <pre><code>app.post('/openFolder', function(req, res) {
  if (selectedID) {
      console.log(&quot;Action: Open folder: &quot; + FolderPath[selectedID].name);
      spawn('python', ['openIADS.py', FolderPath[selectedID].name])
      setTimeout(function() {
          res.redirect('back');
      }, 10);
  } else {
      setTimeout(function() {
          res.redirect('back');
      }, 10);
  }
  </code></pre>
  <p>});</p>
  <p>where FolderPath[selectedID].name is the path that needs to be opened.</p>
  <p>I am new to node and still trying to figure things out.<br />
  Thanks!</p>
  <p>PS: To be more clear, the app should be visible to the shared network pcs if that helps.</p>