Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with Python -> html
#1
Good afternoon

I'm quite new to Python and I am trying to get the result of a script to show into a html tag - so within my app.py I have the following code;

file = open("blocks.txt", "r")
line_count = 0
for line in file:
    if line != "\n":
        line_count += 1
file.close()

print(line_count)
Then within my index.html I put this;

  <b>IP's Blocked: <label>{{line_count}}</label></b>
As you can imagine, this mustn't be right. How can I get it to work ?
Reply


Messages In This Thread
Help with Python -> html - by lukeyd - Aug-01-2021, 12:39 PM
RE: Help with Python -> html - by ndc85430 - Aug-01-2021, 12:42 PM
RE: Help with Python -> html - by lukeyd - Aug-01-2021, 12:46 PM
RE: Help with Python -> html - by ndc85430 - Aug-01-2021, 12:54 PM
RE: Help with Python -> html - by lukeyd - Aug-01-2021, 01:14 PM
RE: Help with Python -> html - by ndc85430 - Aug-01-2021, 01:22 PM
RE: Help with Python -> html - by lukeyd - Aug-01-2021, 03:17 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Tkinterweb (Browser Module) Appending/Adding Additional HTML to a HTML Table Row AaronCatolico1 0 923 Dec-25-2022, 06:28 PM
Last Post: AaronCatolico1
  reading html and edit chekcbox to html jacklee26 5 3,073 Jul-01-2021, 10:31 AM
Last Post: snippsat
  HTML to Python to Windows .bat and back to HTML perfectservice33 0 1,944 Aug-22-2019, 06:31 AM
Last Post: perfectservice33

Forum Jump:

User Panel Messages

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