Skip to content

Commit

Permalink
Start\end cells added
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximShepelev committed Oct 24, 2018
1 parent 3416321 commit 6abfac0
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 32 deletions.
58 changes: 36 additions & 22 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 22 additions & 6 deletions json/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from tkinter import Tk, Label, Button, Entry, StringVar, W, E, filedialog



# Input Token and Choose File
class File_Token_Chooser:

def __init__(self, master):
Expand All @@ -19,24 +19,37 @@ def __init__(self, master):
self.total_label_text = IntVar()

self.labelT = Label(master, text="Token:")
self.labelF = Label(master, text="File Path:")
self.entry1 = Entry(master, textvariable=self.token) #, validate="key", validatecommand=(vcmd, '%P'))

self.entry2 = Entry(master)
self.labelF = Label(master, text="File Path:")

self.start_cell = Entry(master, text=1)
self.labelStart = Label(master, text='Номер первой ячейки:')

self.end_cell = Entry(master, text=2)
self.labelEnd = Label(master, text='Номер последней ячейки:')

self.ok_button = Button(master, text="OK", command=master.quit)
self.choose_button = Button(master, text="Choose file", command=lambda: self.choose())

# LAYOUT

self.entry1.grid(row=1, column=1, columnspan=3, sticky=W+E)
self.entry2.grid(row=2, column=1, columnspan=3, sticky=W + E)
self.labelT.grid(row=1, column=0)
self.entry2.grid(row=2, column=1, columnspan=3, sticky=W + E)
self.labelF.grid(row=2, column=0)

self.ok_button.grid(row=3, column=0)
self.start_cell.grid(row=3, column=1, columnspan=1, sticky=W + E)
self.labelStart.grid(row=3, column=0)
self.end_cell.grid(row=4, column=1, columnspan=1, sticky=W + E)
self.labelEnd.grid(row=4, column=0)

self.ok_button.grid(row=5, column=0)
self.choose_button.grid(row=2, column=5)

def get_filepath(self):

return self.filepath

def get_toke(self):
Expand All @@ -50,8 +63,11 @@ def choose(self):
my_gui = File_Token_Chooser(root)
root.mainloop()

print(my_gui.get_filepath())
print(my_gui.get_toke())
print("Token entered" + my_gui.get_toke())
print("Using builtin getter, filepath: " + my_gui.entry2.get())
print("Using improvised getter: " + my_gui.get_filepath())
print("Starting cell: " + my_gui.end_cell.get())
print("End cell: " + my_gui.start_cell.get())



Expand Down
4 changes: 0 additions & 4 deletions serpstat.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,9 @@
# Inputting Token for API
master = Tk()
Label(master, text="Token").grid(row=0)
#Label(master, text="Last Name").grid(row=1)
e1 = Entry(master)
#e2 = Entry(master)
e1.grid(row=0, column=1)
#e2.grid(row=1, column=1)
Button(master, text='OK', command=master.quit).grid(row=3, column=0, sticky=W, pady=4)
#Button(master, text='Show', command=show_entry_fields).grid(row=3, column=1, sticky=W, pady=4)
mainloop( )
my_token = e1.get()
print(my_token)
Expand Down

0 comments on commit 6abfac0

Please sign in to comment.