M
Michael Yanowitz
Hello:
Is there a global or some trick I can use to have
Python remember the last directory visited?
What I mean is suppose I have this function:
def get_filename():
""" Returns a filename selected from a Tkinter File Selection Dialog """
strFilename = tkFileDialog.askopenfilename(initialdir='.',
filetypes=[('Python
files','*.py'),
('All
Files','*.*')])
return strFilename
but instead of having initialdir='.' (current directory), I
would like it set to the last visited directory, which can be from a
previous run or even a previous day. Is that possible? If so how?
Thanks in advance:
Michael Yanowitz
Is there a global or some trick I can use to have
Python remember the last directory visited?
What I mean is suppose I have this function:
def get_filename():
""" Returns a filename selected from a Tkinter File Selection Dialog """
strFilename = tkFileDialog.askopenfilename(initialdir='.',
filetypes=[('Python
files','*.py'),
('All
Files','*.*')])
return strFilename
but instead of having initialdir='.' (current directory), I
would like it set to the last visited directory, which can be from a
previous run or even a previous day. Is that possible? If so how?
Thanks in advance:
Michael Yanowitz