本文整理汇总了Python中tumblr.Tumblr.setTags方法的典型用法代码示例。如果您正苦于以下问题:Python Tumblr.setTags方法的具体用法?Python Tumblr.setTags怎么用?Python Tumblr.setTags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tumblr.Tumblr
的用法示例。
在下文中一共展示了Tumblr.setTags方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
# 需要导入模块: from tumblr import Tumblr [as 别名]
# 或者: from tumblr.Tumblr import setTags [as 别名]
print "My available categories:"
for cat in b.getCategories():
print cat
b.setTitle('draft title')
b.setContent('draft content')
# technology exists and was retrieved through getCategories, but
# business doesn't exist so behind the scenes it must be added to
# the system and linked with this post somehow
catList = ['technology', 'business']
b.setCategories(catList)
# The same might happen here if a tag is new
tagsList = ['技术', '商业']
b.setTags(tagsList)
b.setAttachment('/home/marcelo/file.jpg')
if b.postEntry():
print "Article posted!"
else:
print "Article NOT posted!"
b.clear()
b.setTitle('标题')
b.setContent('内容')
if b.postEntry():
print "Article posted!"
else:
print "Article NOT posted!"