Created
June 27, 2018 07:18
-
-
Save lol97/03aa09a243b4d60d3938d7b22a8675d0 to your computer and use it in GitHub Desktop.
punya syafiqur rahman
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from tkinter import * | |
| from tkinter import messagebox,filedialog | |
| from nltk.tokenize import word_tokenize, sent_tokenize | |
| def prosesPilihanNew(): | |
| messagebox.showinfo("Informasi", "Cuma coba-coba") | |
| def prosesPilihanOpen(): | |
| nama = filedialog.askopenfile() | |
| messagebox.showinfo | |
| dataRead = str(nama.read()) | |
| print(dataRead) | |
| print(sent_tokenize(dataRead)) | |
| print(word_tokenize(dataRead)) | |
| nama.close() | |
| def prosesPilihanAbout(): | |
| messagebox.showinfo("Informasi", "Bukan Chumacera!") | |
| jendela = Tk() | |
| menuUtama = Menu(jendela) | |
| jendela.config(menu=menuUtama) | |
| menuFile = Menu (menuUtama, tearoff = 0) | |
| menuUtama.add_cascade(label = "File", menu = menuFile) | |
| menuFile.add_command(label = "New", command=prosesPilihanNew) | |
| menuFile.add_command(label = "Open. . .", command = prosesPilihanOpen) | |
| menuFile.add_separator() | |
| menuFile.add_command(label = "Exit", command = jendela.destroy) | |
| menuBantuan = Menu(menuUtama, tearoff = 0) | |
| menuUtama.add_cascade(label = "Bantuan", menu=menuBantuan) | |
| menuBantuan.add_command(label = "About. . .", command = prosesPilihanAbout) | |
| jendela.mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment