简体   繁体   English

python中的可点击html链接

[英]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.我正在使用 python 2.7.9 并编写了一个程序来帮助我的学生。 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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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