Python url转换成a标签

tornado中自带的工具可以实现

from tornado.escape import linkify
linkify('https://www.google.com/')
Out[8]: 'https://www.google.com/'
linkify('https://www.google.com/',extra_params='target="_blank"')
Out[9]: 'https://www.google.com/'
tornado.escape — Escaping and string manipulation — Tornado 6.1 documentation

你可能感兴趣的:(python)