title: How do I open a new HTML page with eel (python library)?
body: <p>I've just started learning all programming thing and came across this python library "eel" where you can create a decent GUI out of HTML. However, there are not many tutorials available or decent example projects available out there to study from. Here's what I want to do but I don't know how to achieve it. If you guys can help me out, it'd be greatly appreciated.</p>
  
  <ol>
  <li>I have (currently 2) HTML pages one used as a landing page for login (index.html) and one use as a man application (main.html).</li>
  <li>A main.py where I import and connect eel. </li>
  <li>A login.py where I create a list of login credentials: username and password</li>
  </ol>
  
  <p>Basically, when I open the main.py, the index.html will open up, and enter the correct login credential (let's say username: user1 | password: 12345) and hit the button, the main application (main.html) will appear, otherwise it shows "incorrect username or password".</p>
  
  <p>So, the code looks like this in my index.html </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(function() {
  
          eel.expose(open_vwmain);
          function open_vwmain_js(x){
              $(window.location = ".../web/main.html")
          }
  
          &lt;!-- upon button click, html eel sends out the user and pw entered in this index.html to python --&gt;
          $("#btn").click(function() {
              eel.login($("#username").val(), $("#password").val());
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>And in my main.py it looks like this:</p>
  
  <pre><code> eel.init('web')
  @eel.expose                      
  def login(username, password):
      # logic -&gt; Check for right user/ login suceeded
      if username == check_data.USER and password == check_data.PW:
          eel.open_vwmain_js(open_vwmain)
      else:
          eel.open_vwmain_js(error)
  
  eel.start('index.html',size=(800,600), port=8080)
  </code></pre>
  
  <p>Note, I have not added the popup error message yet because it isn't that important for now. I just have no idea how to make this first step to work yet. </p>
  
  <p>Thanks a lot guys!</p>