1

我正在尝试制作我的前半部分 GUI 程序,并且我正在使用tkinter,但我无法弄清楚它为什么不起作用。

import Tkinter
import tkMessageBox
import os 
from Tkinter import *
import Tkinter
import tkMessageBox

root = Tkinter.Tk()

#text

text = Text(root)
text.insert(INSERT, "EASY hacktool for Linux\n\n1.john\n2.Crack wep\n3.Crack wpa/wpa2\n q to quit\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n  \n\n\n\n\n\n\n\n\n\n\n", )
text.tag_add("here", "1.0", "25.50")
text.tag_config("here", background="black", foreground="green")
text.pack()


def key(event):
    if event.keysym == 'q':
        root.destroy()
    elif event.keysym == '\x31':
        os.system("python Gui/john.py")
    elif event.keysym == '\x32':
        os.system("python Gui/aircrack.py")

root.bind_all('<Key>', key)


root.mainloop()

当我按下 1 (\x31) 时,它可以正常工作,但是当我按下 '2'(\x32) 时,什么也没有发生,我尝试了 my aircrack.py,它可以正常工作,但这没有。

4

1 回答 1

0

the code works fine for me if i replace

os.system("python Gui/aircrack.py")

with just some print statement...does it work for you? what is your aircrack.py?Make sure it is in the same path.

于 2012-11-01T10:07:31.147 回答