<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://wiki.swarma.org/index.php?action=history&amp;feed=atom&amp;title=%E4%BD%BF%E7%94%A8python%E7%94%BB%E6%96%87%E5%AD%97%E4%BA%91</id>
	<title>使用python画文字云 - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.swarma.org/index.php?action=history&amp;feed=atom&amp;title=%E4%BD%BF%E7%94%A8python%E7%94%BB%E6%96%87%E5%AD%97%E4%BA%91"/>
	<link rel="alternate" type="text/html" href="https://wiki.swarma.org/index.php?title=%E4%BD%BF%E7%94%A8python%E7%94%BB%E6%96%87%E5%AD%97%E4%BA%91&amp;action=history"/>
	<updated>2026-11-03T04:22:11Z</updated>
	<subtitle>本wiki的该页面的版本历史</subtitle>
	<generator>MediaWiki 1.35.0</generator>
	<entry>
		<id>https://wiki.swarma.org/index.php?title=%E4%BD%BF%E7%94%A8python%E7%94%BB%E6%96%87%E5%AD%97%E4%BA%91&amp;diff=15478&amp;oldid=prev</id>
		<title>思无涯咿呀咿呀：创建页面，内容为“ 600px   安装包需求：   首先要安装PDFMiner以把一个PDF文件转成txt文件。在[https://pypi.python.org/pypi/pdfminer/ 这…”</title>
		<link rel="alternate" type="text/html" href="https://wiki.swarma.org/index.php?title=%E4%BD%BF%E7%94%A8python%E7%94%BB%E6%96%87%E5%AD%97%E4%BA%91&amp;diff=15478&amp;oldid=prev"/>
		<updated>2020-10-16T09:55:03Z</updated>

		<summary type="html">&lt;p&gt;创建页面，内容为“ &lt;a href=&quot;/index.php/%E6%96%87%E4%BB%B6:Cloud_large.png&quot; title=&quot;文件:Cloud large.png&quot;&gt;600px&lt;/a&gt;   安装包需求：   首先要安装PDFMiner以把一个PDF文件转成txt文件。在[https://pypi.python.org/pypi/pdfminer/ 这…”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
[[File:cloud_large.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
安装包需求：&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
首先要安装PDFMiner以把一个PDF文件转成txt文件。在[https://pypi.python.org/pypi/pdfminer/ 这里]下载，在[http://www.unixuser.org/~euske/python/pdfminer/index.html#todo 这里]是文件使用说明。&lt;br /&gt;
&lt;br /&gt;
其次要安装[http://www.pygame.org/download.shtml Pygame](windows下要用msi安装包安装，用easy_install有可能出错)。&lt;br /&gt;
&lt;br /&gt;
接着安装simplejson，使用easy_install即可。&lt;br /&gt;
&lt;br /&gt;
最后，easy_install安装[https://pypi.python.org/pypi/pytagcloud pytagcloud]即可。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
    from pytagcloud import create_tag_image, make_tags&lt;br /&gt;
    from pytagcloud.lang.counter import get_tag_counts&lt;br /&gt;
    from collections import Counter&lt;br /&gt;
    import random&lt;br /&gt;
     &lt;br /&gt;
    f = open(&amp;quot;E:\wulingfei\data_science_and_prediction.txt&amp;quot;,&amp;quot;r&amp;quot;).read()&lt;br /&gt;
    s=f.split(&amp;quot;\n&amp;quot;)&lt;br /&gt;
    tt=[i.strip(&amp;quot; &amp;quot;) for i in s if len(i)&amp;gt;40]&lt;br /&gt;
    text=[]&lt;br /&gt;
    for j in tt:&lt;br /&gt;
        j = j.split(&amp;quot; &amp;quot;)&lt;br /&gt;
        for i in j:&lt;br /&gt;
            if len(i)&amp;gt;5:&lt;br /&gt;
                text.append(i)&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    ct=Counter(text)&lt;br /&gt;
    nct={key:ct[key] for key in ct if ct[key]&amp;gt;4}&lt;br /&gt;
    nt=&amp;quot; &amp;quot;.join([i for i in text if i in nct])&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    tags = make_tags(get_tag_counts(nt), maxsize=100)&lt;br /&gt;
    create_tag_image(tags, 'E:\wulingfei\cloud_large.png', size=(900, 600), fontname='Lobster')&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:python]]&lt;br /&gt;
[[category:旧词条迁移]]&lt;/div&gt;</summary>
		<author><name>思无涯咿呀咿呀</name></author>
	</entry>
</feed>