Exemplo n.º 1
0
 def showup(self):
     self.psr = Processor()
     self.root = Tk()
     self.root.title("MOPS資訊觀測站")
     frame = Frame(self.root)
     frame.grid(row=0, column=0, sticky="news")
     self.stateV = StringVar()
     self.stateV.set("日期格式:yyyymmdd")
     self.statebarL = Label(frame, textvariable=self.stateV)
     sdateL = Label(frame, text="開始日期")
     edateL = Label(frame, text="迄止日期")
     self.sdateE = Entry(frame)
     self.edateE = Entry(frame)
     self.goBtn = Button(frame, text="確定", command=self.runProcess)
     self.statebarL.grid(row=0, column=0, rowspan=1, columnspan=3, sticky="news")
     sdateL.grid(row=1, column=0, rowspan=1, columnspan=1, sticky="news")
     edateL.grid(row=2, column=0, rowspan=1, columnspan=1, sticky="news")
     self.sdateE.grid(row=1, column=1, rowspan=1, columnspan=1, sticky="news")
     self.edateE.grid(row=2, column=1, rowspan=1, columnspan=1, sticky="news")
     self.goBtn.grid(row=1, column=2, rowspan=2, columnspan=1, sticky="news")
     Grid.grid_rowconfigure(self.root, 0, weight=1)
     Grid.grid_columnconfigure(self.root, 0, weight=1)
     self.root.mainloop()
Exemplo n.º 2
0
from tkinter import filedialog as fd
from tkinter import Grid
from tkinter import messagebox
from zipfile import is_zipfile
from updateablezipfile import UpdateableZipFile
import os.path
import configparser
from xml.dom import minidom

# consider this one day for SAT to step https://github.com/jmplonka/InventorLoader/blob/master/Acis2Step.py

gui = tk.Tk()
gui.title('DSM Tools')
gui.minsize(800, 100)
gui.eval('tk::PlaceWindow . center')
Grid.grid_columnconfigure(gui, 1, weight=1)


def open_file_dialog():
    # retrieve last directory used
    initial_path = '/'
    if os.path.isdir(rsdocfile.get()):
        initial_path = os.path.dirname(os.path.abspath(rsdocfile.get()))
        print(initial_path)

    # open file dialog
    filename = fd.askopenfilename(
        initialdir=initial_path,
        title='Select Design Spark Mechanical Document',
        filetypes=(('RSDoc', '*.rsdoc'), ('all files', '*.*')))
    if filename: