简体   繁体   中英

clickable html links in python

I am looking for a way to make a link clickable. I'm using python 2.7.9 and have written a program to help my students. Each indicator of their writing has a link attached for further help. Right now, they are just printed and the students need to copy and paste the file. How do I make them clickable. Opening in another window would be ideal, but I really just want to have the link open.

as an example:

tx="# of pronouns"
        t1=iTest["pro"]
        t2=round(100*t1/number_of_words,1)
        tc='''      
                    You are not to use inclusive pronouns
                    in academic writing.
                    Please go to http://owll.massey.ac.nz/academic-writing/1st-vs-3rd-person.php to review.'''
        row="<tr><td ><pro>"+tx+"</pro></td> <td>"+str(t1)+"</td> <td>"+str(t2)+"%</td> <td>"+tc+"</td>"
        if t1>0: fo.writelines(row) #only print this row if there are personal pronouns

Do you want to achieve something like this:

 <a href="http://owll.massey.ac.nz/academic-writing/1st-vs-3rd-person.php"> http://owll.massey.ac.nz/academic-writing/1st-vs-3rd-person.php </a>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM