![]() | 1 | initial version |
Ok I've figured it out as well as fixed the bug that plagued my earlier idea.
import Tkinter, tkFileDialog, ntpath
root = Tkinter.Tk()
root.withdraw()
filetypes = [('Excel Workbook', '.xlsx'),('All Files','.*')]
filenamesaveas = tkFileDialog.asksaveasfilename(filetypes=filetypes, title='Results Workbook Name')
xlsfilename = ntpath.basename(filenamesaveas)
The 'root = Tkinter.Tk()' etc is to stop a dummy Tkinter window coming up that crashes PSS/E if it's closed.
![]() | 2 | No.2 Revision |
Ok I've figured it out as well as fixed the bug that plagued my earlier idea. idea (sorry this posted code still doesn't look that good).
import Tkinter, tkFileDialog, ntpath
ntpath
root = Tkinter.Tk()
root.withdraw()
root.withdraw()
filetypes = [('Excel Workbook', '.xlsx'),('All Files','.*')] filenamesaveas = tkFileDialog.asksaveasfilename(filetypes=filetypes, title='Results Workbook Name')
xlsfilename = ntpath.basename(filenamesaveas)
The 'root = Tkinter.Tk()' etc is to stop a dummy Tkinter window coming up that crashes PSS/E if it's closed.
![]() | 3 | No.3 Revision |
Ok I've figured it out as well as fixed the bug that plagued my earlier idea (sorry this posted code still doesn't look that good).
import Tkinter, tkFileDialog, ntpath
root = Tkinter.Tk()
root.withdraw()
filetypes = [('Excel Workbook', '.xlsx'),('All Files','.*')]
.*')]
filenamesaveas = tkFileDialog.asksaveasfilename(filetypes=filetypes, title='Results Workbook Name')
xlsfilename = ntpath.basename(filenamesaveas)
The 'root = Tkinter.Tk()' etc is to stop a dummy Tkinter window coming up that crashes PSS/E if it's closed.
![]() | 4 | highlighted code |
Ok I've figured it out as well as fixed the bug that plagued my earlier idea (sorry this posted code still doesn't look that good).
import Tkinter, tkFileDialog, The 'root = Tkinter.Tk()' etc is to stop a dummy Tkinter window coming up that crashes PSS/E if it's closed.
![]() | 5 | No.5 Revision |
Ok I've figured it out as well as fixed the bug that plagued my earlier idea (sorry this posted code still doesn't look that good).
import Tkinter, tkFileDialog, ntpath
root = Tkinter.Tk()
root.withdraw()
filetypes = [('Excel Workbook', '*.xlsx'),('All Files','*.*')]
filenamesaveas = tkFileDialog.asksaveasfilename(filetypes=filetypes, tkFileDialog.asksaveasfilename(
filetypes=filetypes,
title='Results Workbook Name')
xlsfilename = ntpath.basename(filenamesaveas)
The 'root = Tkinter.Tk()' etc is to stop a dummy Tkinter window coming up that crashes PSS/E if it's closed.