-3
我創建了一個非常(非常)簡單的程序來獲取法語單詞,然後打開法語字典的選項卡。如何爲我的程序創建一個GUI
#Made by Will Bishop with help from cdonts
import webbrowser
import sys
trans = True
n = 1
while trans == True:
if n > 1:
s = input('Another one: ')
if n == 1:
s = input('French Word/Sentence: ')
if n < 1:
print('I am not entirely sure how this happened, but isn\'t this embarrasing')
s = (s.lower())
word = ("".join(c for c in s if c.isalpha() or c in " '"))
list = word.split()
lang = 'fren'
for word in list:
webbrowser.open('http://www.wordreference.com/' + (lang) + '/' + (str(word)))
n = n + 1
然後使用Py2EXE我設法得到它到一個EXE文件,並已經使安裝程序。但是在我給這個程序給人之前,我真的很想要一個GUI。我想嘗試使用Tkinter,但我不確定我可以在Tkinter中實現我的代碼,以便爲我的程序提供GUI,而不是DOS樣式的程序。
在此先感謝!