Geocrack

pyscript_1

Sep 12th, 2022 (edited)
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.84 KB | None | 0 0
  1. <!DOCTYPE html>
  2.  
  3. <html>
  4.  
  5. <head>
  6.   <meta charset="utf-8">
  7.   <title>Enigma</title>
  8.   <link rel="stylesheet" href="https://pyscript.net/latest/pyscript.css" />
  9.   <script defer src="https://pyscript.net/latest/pyscript.js"></script>
  10. </head>
  11.  
  12. <body>
  13.   <div>Textfeld_1</div>
  14.   <input type="text" id="test-input"/>
  15.   <button id="submit-button" type="submit" pys-onClick="test_function">OK</button>
  16.   <div id="test-output"></div>
  17.  
  18. <py-script>
  19. from js import console
  20.  
  21. def test_function(*args, **kwargs):
  22.  
  23.     #print('args:', args)
  24.     #print('kwargs:', kwargs)
  25.  
  26.     console.log(f'args: {args}')
  27.     console.log(f'kwargs: {kwargs}')
  28.    
  29.     text = Element('test-input').element.value
  30.  
  31.     #print('text:', text)
  32.     console.log(f'text: {text}')
  33.  
  34.     Element('test-output').element.innerText = text
  35. </py-script>
  36.  
  37.   </body>
  38. </html>
Advertisement
Add Comment
Please, Sign In to add comment