Python Forum
Having my output links become clickable
Thread Rating:
  • 2 Vote(s) - 4.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Having my output links become clickable
#9
(May-25-2017, 08:05 PM)snippsat Wrote: You could replace \n with <br>,
but better making it a html list bye add <li>.

lst.txt:
Output:
<a href="https://python-forum.io">The best Python forum</a> <a href="https://python-forum.io">The best Python forum</a>
with open('lst.txt') as f,open('link.html', 'w') as f_out:
   for link in f:
       link = link.strip()
       make_list = '<li>{}</li>'.format(link)
       f_out.write('{}\n'.format(make_list))
link.html:
Output:
<li><a href="https://python-forum.io">The best Python forum</a></li> <li><a href="https://python-forum.io">The best Python forum</a></li>



This works great. (I tried the list feature of html). Thank you.   Smile
Reply


Messages In This Thread
RE: Having my output links become clickable - by bigmit37 - May-25-2017, 08:17 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Sad "Disabled" Buttons Still Clickable. Nd4SpdSe 3 372 Mar-13-2024, 07:44 AM
Last Post: laughorchestra
  help with url links- href links don't work properly DeBug_0neZer0 1 1,996 Jan-06-2021, 11:01 PM
Last Post: DeBug_0neZer0
  How to turn screen output into clickable hyperlinks windros 5 2,762 Jan-22-2019, 05:41 PM
Last Post: windros

Forum Jump:

User Panel Messages

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