小编Abk*_*bkb的帖子

如何使用python更改tkinter中按钮和框架的字体和大小?

这是我用来在tkinter中生成简单文本框和按钮的代码.

什么参数可以更好地了解框架和按钮?

 root = Tk.Tk()

 def submit():
    query = entry.get()
    retrieve(query)
    entry = Tk.Entry(root)
    entry.pack()
    button = Tk.Button(root, text='submit', command=submit)
    button.pack()
    root.mainloop()             
Run Code Online (Sandbox Code Playgroud)

python tk-toolkit tkinter

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

如何使用python创建一个简单的饼图

我一直试图使用python生成一个简单的饼图,只使用两个变量.代表百分比.我总是"vcvarsall.bat" not found在安装matplotlib包时遇到错误.是不是已经不可避免地要安装Visual Studio了?

python matplotlib pie-chart

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

TypeError:'tuple'对象不支持字典中的项目赋值

无法对字典元素的相应值进行增量

sentiment_words = {}
for word in TotalVector:
    if not word in sentiment_words:
        sentiment_words[word]=(0,0,0)
        #sentiment_word(positive,negative,neutral)
    if ispositive(word):
        sentiment_words[word][0] += 1
    elif isnegative(word):
        sentiment_words[word][1] += 1
    elif isneutral(word):
        sentiment_words[word][2] += 1

print sentiment_words
Run Code Online (Sandbox Code Playgroud)

python dictionary

0
推荐指数
1
解决办法
1741
查看次数

标签 统计

python ×3

dictionary ×1

matplotlib ×1

pie-chart ×1

tk-toolkit ×1

tkinter ×1