我想用 Python 制作最简单的 Url 缩短器。
像这样:
link = input("Type your link:")
#print output
如果需要,我可以使用这个 Python 库。
I want the code to be as simple as possible - 10 lines maximum.
代码必须高效。
最佳答案
Python 中最简单的 Url 缩短器:
import pyshorteners
#link = 'https://yourwebsitehere.com/'
link = input("Type your link")
print(pyshorteners.Shortener().clckru.short(link))
#output: https://clck.ru/*****
关于python-3.x - 最简单的 python 链接缩短器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66748006/