Python Forum
pyscript index error while calling input from html form
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pyscript index error while calling input from html form
#1
Hi,
I am trying to embed a python script into an html page via pyscript. I want to call the input from an html form. In python script, if I use
input = "word"
everything works fine, however if I use
word = Element('word').value
then it gives
Error:
IndexError: range object index out of range
Of course I used an html form as follows
	<form onsubmit="return false">
	<label>Enter the word:</label>
    <input type="text" id="word">
    </form>
Any ideas and suggestions to solve this problem would be appreciated. Thank you.
Reply


Messages In This Thread
pyscript index error while calling input from html form - by pyscript_dude - May-19-2023, 02:56 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Input error correction. shakoun 4 1,802 Jun-07-2024, 12:59 PM
Last Post: menator01
  Index error help MRsquared 1 1,526 May-15-2023, 03:28 PM
Last Post: buran
  Embedding python script into html via pyscript pyscript_dude 7 4,972 Apr-16-2023, 11:17 PM
Last Post: pyscript_dude
  Tkinterweb (Browser Module) Appending/Adding Additional HTML to a HTML Table Row AaronCatolico1 0 2,010 Dec-25-2022, 06:28 PM
Last Post: AaronCatolico1
  Error in Using INPUT statement gunwaba 1 3,012 Jul-03-2022, 10:22 PM
Last Post: deanhystad
  I'm getting a String index out of range error debian77 7 4,190 Jun-26-2022, 09:50 AM
Last Post: deanhystad
Star I'm getting syntax error while using input function in def. yecktmpmbyrv 1 2,909 Oct-06-2021, 09:39 AM
Last Post: menator01
  Python Error List Index Out of Range abhi1vaishnav 3 4,748 Sep-03-2021, 08:40 PM
Last Post: abhi1vaishnav
  Index error - columns vs non-column Vinny 3 6,726 Aug-09-2021, 04:46 PM
Last Post: snippsat
  Error creating database with python and form? shams 3 3,498 Aug-02-2021, 02:00 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020