这是python代码:
import pyshorteners as p
link=input("Enter the link: ")
shortner=p.tinyurl.short(link)
x=shortner.tinyurl.short(link)
print(x)
这是错误:
module 'pyshorteners' has no attribute 'tinyurl'
这是python代码:
import pyshorteners as p
link=input("Enter the link: ")
shortner=p.tinyurl.short(link)
x=shortner.tinyurl.short(link)
print(x)
这是错误:
module 'pyshorteners' has no attribute 'tinyurl'
代替
shortner=p.tinyurl.short(link)
和
shortner=p.Shortener()
那是因为pyshorteners
没有属性tinyurl
尝试使用文档中的示例(https://pyshorteners.readthedocs.io/en/latest/apis.html#tinyurl-com)
import pyshorteners
s = pyshorteners.Shortener()
s.tinyurl.short('http://www.google.com')