title: How to simulate a console in Pyscript?
body: <p>I want to host a python script on a website with pyscript, which has both console input and console output. If I want to give it a console input via the input(&quot;test&quot;) function, then just comes</p>
  <p><a href="https://ibb.co/k2gjrSx" rel="nofollow noreferrer">https://ibb.co/k2gjrSx</a></p>
  <p>and i can't see the output with print(&quot;output&quot;) either.</p>
  <p>I then found an example script, but it only works 1.</p>
  <p><a href="https://ibb.co/By9B28D" rel="nofollow noreferrer">https://ibb.co/By9B28D</a></p>
  <pre><code>&lt;!DOCTYPE html&gt;
  
  &lt;html&gt;
  
  &lt;head&gt;
    &lt;!--&lt;link rel=&quot;stylesheet&quot; href=&quot;https://pyscript.net/alpha/pyscript.css&quot; /&gt;--&gt;
    &lt;script defer src=&quot;https://pyscript.net/alpha/pyscript.js&quot;&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;div&gt;textfield_1&lt;/div&gt;
    &lt;input type=&quot;text&quot; id=&quot;test-input&quot;/&gt;
    &lt;button id=&quot;submit-button&quot; type=&quot;submit&quot; pys-onClick=&quot;my_function&quot;&gt;OK&lt;/button&gt;
    &lt;div id=&quot;test-output&quot;&gt;&lt;/div&gt;
  
  &lt;py-script&gt;
  from js import console
  
  def my_function(*args, **kwargs):
  
      #print('args:', args)
      #print('kwargs:', kwargs)
  
      console.log(f'args: {args}')
      console.log(f'kwargs: {kwargs}')
      
      text = Element('test-input').element.value
  
      #print('text:', text)
      console.log(f'text: {text}')
  
      Element('test-output').element.innerText = text
  &lt;/py-script&gt;
  
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>In addition, it would be better if you can also execute the command with ENTER and that you can also rewrite the &quot;textfield_1&quot; as an instruction (what to type in the field)</p>
  <p>I would be grateful for any help</p>