Python Forum
Embedding python script into html via pyscript
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Embedding python script into html via pyscript
#4
You don't have a variable named input_str assigned outside my_function().
    def my_function():
        input_str = Element('input.str').value  # Assigned inside function
        n = int(Element('n').value)
 
    input_list = input_str.split(",")  #  Never assigned out here
Is this an indentation error?
for i in range(len(w)):
    if (w[i] % n == 0):
    A[w[i]//n - 1, n-1] = int(i+1)
else:
    A[w[i]//n, w[i]%n-1] = int(i+1)

    result_place = Element('output')   # Should these lines be same depth as else?
    result_place.write(str(A))
Reply


Messages In This Thread
RE: Embedding python script into html via pyscript - by deanhystad - Apr-16-2023, 04:53 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  speed up getting embedding from bert model for large set of text veda 7 2,461 May-27-2024, 08:28 AM
Last Post: Pedroski55
  Is there a *.bat DOS batch script to *.py Python Script converter? pstein 3 8,435 Jun-29-2023, 11:57 AM
Last Post: gologica
  pyscript index error while calling input from html form pyscript_dude 2 2,088 May-21-2023, 08:17 AM
Last Post: snippsat
  Tkinterweb (Browser Module) Appending/Adding Additional HTML to a HTML Table Row AaronCatolico1 0 1,963 Dec-25-2022, 06:28 PM
Last Post: AaronCatolico1
  C++ python embedding comarius 0 1,305 Aug-26-2022, 02:01 AM
Last Post: comarius
  reading html and edit chekcbox to html jacklee26 5 4,552 Jul-01-2021, 10:31 AM
Last Post: snippsat
Question Embedding a python file online Dreary35 0 1,995 Jun-10-2021, 05:05 PM
Last Post: Dreary35
  Embedding python cause crash when use boost::asio multi threading udvatt108 0 2,226 Oct-04-2020, 03:15 PM
Last Post: udvatt108
  Need help merging/embedding duckredbeard 10 5,263 Aug-13-2020, 04:48 AM
Last Post: duckredbeard
  How to kill a bash script running as root from a python script? jc_lafleur 4 8,293 Jun-26-2020, 10:50 PM
Last Post: jc_lafleur

Forum Jump:

User Panel Messages

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