Python 将konsole或gnome终端嵌入Tkinter框架内
我能够将xterm嵌入Tkinter GUI框架:Python 将konsole或gnome终端嵌入Tkinter框架内,python,tkinter,xterm,gnome-terminal,konsole,Python,Tkinter,Xterm,Gnome Terminal,Konsole,我能够将xterm嵌入Tkinter GUI框架: Frame2 = Frame(master) Frame2.pack(fill=BOTH, expand=YES) wid = Frame2.winfo_id() os.system('xterm -into %d -hold -geometry 300x10 -sb &' % wid) 但这不起作用: Frame2 = Frame(master) Frame2.pack(fill=BOTH, expand=YES) wid = Fr
Frame2 = Frame(master)
Frame2.pack(fill=BOTH, expand=YES)
wid = Frame2.winfo_id()
os.system('xterm -into %d -hold -geometry 300x10 -sb &' % wid)
但这不起作用:
Frame2 = Frame(master)
Frame2.pack(fill=BOTH, expand=YES)
wid = Frame2.winfo_id()
os.system('gnome-terminal' % wid)
TypeError: not all arguments converted during string formatting
我能以任何方式在框架上嵌入konsole或gnome终端吗?我对Ubuntu没有太多经验,但在键入
- xterm-帮助
- 康索尔-帮助
- gnome终端——帮助
我在Gtk中这样做,但请记住,对于Wayland,它们都在删除对插座和插头的支持,这是在其他设备中嵌入窗口的机制。在
gnome-terminal'%wid
中,字符串中没有放置wid
值的位置。您可能在那里的某个地方有一个%d
。如果我使用os.system('gnome-terminal-into%d-hold-geometry 300x10-sb&'%wid'),它将作为未知选项-into(也称为into)。这不是解决方案。我在xterm语句中找不到与-into等价的语句。但是,我所做的是改变背景,现在看起来更像konsole,我想把它插入框架中。os.system('xterm-fg white-bg black-into%d-hold-geometry 300x10-sb&'%wid')我并不是说我对你的问题有一个解决方案(因为老实说,我甚至不明白你想要什么),我只是告诉你你的类型错误是从哪里来的。是的,我尝试了几种方法。您没有使用%d,它没有与帧id连接,但是当您没有嵌入xterm而嵌入konsole或gnome终端时,问题是-into(两者都没有-into)被识别出来。我可以同时打开两个,但只能在框架内使用xterm。我找到了打开gnome终端或konsole的方法,但不是在tkinter框架内。无论如何,谢谢你的回答。它澄清了一点为什么我不能。gnome终端或konsole的os.system上有指向属性的链接吗?我没有发现任何与此相关的东西。我看到的问题是每次重新启动系统时,我都需要执行xrdb-merge/etc/X11/Xresources/X11 common。我想每次我的程序启动时,我都需要用这个命令执行一个进程
XTerm*faceName: Bitstream Vera Serif Mono
xterm*faceSize: 11
xterm*vt100*geometry: 80x60
xterm*saveLines: 16384
xterm*loginShell: true
xterm*charClass: 33:48,35:48,37:48,43:48,45-47:48,64:48,95:48,126:48
xterm*termName: xterm-color
xterm*eightBitInput: false
!BLK Cursor
#define _color0 #000d18
#define _color8 #000d18
!RED Tag
#define _color1 #e89393
#define _color9 #e89393
!GRN SpecialKey
#define _color2 #9ece13
#define _color10 #9ece13
!YEL Keyword
#define _color3 #f0dfaf
#define _color11 #f0dfaf
!BLU Number
#define _color4 #8cd0d3
#define _color12 #8cd0d3
!MAG Precondit
#define _color5 #c0bed1
#define _color13 #c0bed1
!CYN Float
#define _color6 #dfaf8f
#define _color14 #dfaf8f
!WHT Search
#define _color7 #efefef
#define _color15 #efefef
!FMT Include, StatusLine, ErrorMsg
#define _colorBD #ffcfaf
#define _colorUL #ccdc90
#define _colorIT #80d4aa
!TXT Normal, Normal, Cursor
#define _foreground #dcdccc
#define _background #1f1f1f
#define _cursorColor #8faf9f
URxvt*color0 : _color0
URxvt*color1 : _color1
URxvt*color2 : _color2
URxvt*color3 : _color3
URxvt*color4 : _color4
URxvt*color5 : _color5
URxvt*color6 : _color6
URxvt*color7 : _color7
URxvt*color8 : _color8
URxvt*color9 : _color9
URxvt*color10 : _color10
URxvt*color11 : _color11
URxvt*color12 : _color12
URxvt*color13 : _color13
URxvt*color14 : _color14
URxvt*color15 : _color15
URxvt*colorBD : _colorBD
URxvt*colorIT : _colorIT
URxvt*colorUL : _colorUL
URxvt*foreground : _foreground
URxvt*background : _background
URxvt*cursorColor : _cursorColor
XTerm*color0 : _color0
XTerm*color1 : _color1
XTerm*color2 : _color2
XTerm*color3 : _color3
XTerm*color4 : _color4
XTerm*color5 : _color5
XTerm*color6 : _color6
XTerm*color7 : _color7
XTerm*color8 : _color8
XTerm*color9 : _color9
XTerm*color10 : _color10
XTerm*color11 : _color11
XTerm*color12 : _color12
XTerm*color13 : _color13
XTerm*color14 : _color14
XTerm*color15 : _color15
XTerm*colorBD : _colorBD
XTerm*colorIT : _colorIT
XTerm*colorUL : _colorUL
XTerm*foreground : _foreground
XTerm*background : _background
XTerm*cursorColor : _cursorColor