小编use*_*727的帖子

如何从Python中查看Tumblr帖子的所有注释?

我说看下面的Tumblr帖子:http ://ronbarak.tumblr.com/post/40692813 ...
它(目前)有292个音符.

我想使用Python脚本(例如,通过urllib2,BeautifulSoup,simplejson或tumblr Api)获取上述所有注释.一些广泛的谷歌搜索没有产生任何与Tumblr中的笔记提取相关的项目.

任何人都可以指出我在哪个工具上让我这样做的正确方向?

python urllib2 beautifulsoup tumblr

9
推荐指数
2
解决办法
1万
查看次数

matplotlib的相同注释中的字体大小不同?

我需要用几条数据线注释一个pylab矩形 - 这些数据行的长度不同.搜索matplotlib文档和谷歌搜索,我找不到一种方法来给注释的不同部分提供不同的大小.

以下代码段演示了此问题:

import pylab
from matplotlib.patches import Rectangle
pylab.rcParams['verbose.level'] = 'debug-annoying' 

def draw_rectangle(lower, upper, entry):
    ax = pylab.subplot(111)
    r = Rectangle( lower, upper[0]-lower[0], upper[1] - lower[1],
            edgecolor='k')
    ax.add_patch(r)

    textRank = str(entry['rank'])
    textTeamName = entry['teamName']
    textSubmissionDate = entry['submissionDate']
    text = textRank + "\n" + textTeamName + "\n" + textSubmissionDate

    ax.add_artist(r)
    rx, ry = r.get_xy()
    cx = rx + r.get_width()/2.0
    cy = ry + r.get_height()/2.0

    ax.annotate(text, (cx, cy), color='w', weight='bold', ha='center', va='center', size=14)

if __name__ == '__main__':
    entry …
Run Code Online (Sandbox Code Playgroud)

annotations matplotlib rectangles font-size treemap

9
推荐指数
2
解决办法
2万
查看次数