python-3.x - 最简单的 python 链接缩短器

标签 python-3.x url

我想用 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/

相关文章:

Python时间限制

python - 无法导入 'pymongo'

python - 无法在 Python 中导入 Skype4Py

java - 如何将URL类型的图像输入到imageviewer中

regex - 如何在没有方案的情况下为 URL 编写正则表达式?

excel - 使用 StyleFrame 的 to_excel 方法将多个 python 数据帧复制到 Excel 中

python - 获取二维数组中每列的第二个最小值

javascript - 如何解析 URL 的 json 输出

json - 解析 HTML 以快速获取 JSON

android - 使用 GSON 从 URL 解析 JSON