小编esm*_*mit的帖子

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
查看次数

bash命令行stdin如何传播到子进程

我有一个脚本(file_redirection.sh),我尝试了各种组合来获得我想要的东西:

#!/bin/bash
echo "cat " $*
echo "cat $*"
echo "cat $@"
echo "cat " $@
Run Code Online (Sandbox Code Playgroud)

我希望能够跑

file_redirection.sh < tmp_file
Run Code Online (Sandbox Code Playgroud)

并让它显示

"cat < tmp_file"
Run Code Online (Sandbox Code Playgroud)

那可能吗?

bash

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

标签 统计

bash ×1

python ×1

tkinter ×1

xterm ×1