相关疑难解决方法(0)

有没有办法将Python Shell输出放在tkinter窗口中?

我想知道是否有可能(如果是这样,如何)Python Shelltkinter我所做的窗口内输出和输入.我在谷歌搜索,但我似乎找不到任何东西.如果可能的话,是否有初学者可以理解的简短版本.(我试过的所有网站都无法理解.)

这是我的代码:

from tkinter import *



def Exit():
    print()

def newClassResults():
    #assigns variable to an input so it can be reffered to later
    amount = int(input("How many people would you like to add? "))

    #starts for loop
    for counter in range(amount):
#assigns inputto a  variable called 'newName'
        newName = input("\nEnter the new student's name: ")
#assigns input to a  variable called 'newScore'
        newScore = int(input("Enter the new student's score: "))
#adds new results to the …
Run Code Online (Sandbox Code Playgroud)

python shell tkinter

5
推荐指数
1
解决办法
5054
查看次数

tk嵌入式xterm的大小如何是动态的?

可以编写一个简单的python脚本来嵌入xtermtk框架中:

from Tkinter import *
import subprocess

root = Tk()
termf = Frame(root, height=800, width=1000)

termf.pack(fill=BOTH, expand=YES)
wid = termf.winfo_id()
Run Code Online (Sandbox Code Playgroud)

窗口建立后

proc = subprocess.Popen('xterm -into %d -sb ' % wid,shell=True)
root.mainloop()
Run Code Online (Sandbox Code Playgroud)

在我的电脑上看起来像 嵌入式xtermtermf即使调整框架大小(通过拖动角落), 如何使嵌入式xterm动态调整大小到框架的大小?

python tkinter xterm

5
推荐指数
1
解决办法
348
查看次数

标签 统计

python ×2

tkinter ×2

shell ×1

xterm ×1