title: How to import library using Brython
body: <p>I wish to import my own library in Brython. <a href="https://brython.info/static_doc/en/import.html" rel="noreferrer">This page of the documentation</a> purports to show how, by adding the appropriate directory to the python path, but I can't make it work because I can't make Brython import <em>sys</em>.</p>
  
  <p>Here's the simplest example code from the first page of the Brython documentation:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script src="../src/Brython3.2.8/brython.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body onload="brython()"&gt;
  &lt;script type="text/python"&gt;
    from browser import document, alert
  
    def echo(ev):
      alert(document["zone"].value)
  
    document['mybutton'].bind('click', echo)
  &lt;/script&gt;
  &lt;input id="zone"&gt;&lt;button id="mybutton"&gt;click !&lt;/button&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>And that works fine.</p>
  
  <p>But if I try to import sys:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script src="../src/Brython3.2.8/brython.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body onload="brython()"&gt;
  &lt;script type="text/python"&gt;
    import sys
    from browser import document, alert
  
    def echo(ev):
      alert(document["zone"].value)
  
    document['mybutton'].bind('click', echo)
  &lt;/script&gt;
  &lt;input id="zone"&gt;&lt;button id="mybutton"&gt;click !&lt;/button&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Then the html will display but the button will not do anything.</p>
  
  <p>The Console on Chrome shows the following error:</p>
  
  <pre><code>brython.js:6929 XMLHttpRequest cannot load file:///C:/Users/XXXXXXXXX/XXXXXX/src/Brython3.2.8/Lib/sys.py?v=1476283159509. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
      $download_module    @ brython.js.6929
      import_py           @ brython.js.6929
      exec_module         @ brython.js.6929
  etc etc
  </code></pre>
  
  <p>So, how can I import sys in brython, and/or how can I import my own library in python?</p>
  
  <p>Thanks.</p>