How to Create a Restricted File Browser in Python for Windows
<p>I’d like to create a restricted folder/ file explorer in Python (I have version 2.7.9, but I don’t mind changing that) for Windows.</p>

<p>Essentially, I want to initially specify the folder to which the code opens. For example, the code should initially open to: <code>C:\Users\myName\Desktop\myDemoFolder</code> (the user must not know this folder simply by looking at the GUI).</p>

<p>The user must be able to browse downwards (deeper into folders) and backwards (but only up to the initial folder to which the code opens). The user must be able to click to open a file  (for example: pdf), and the file must automatically open in its default application.</p>

<p>An example of what I’d like is presented in figure 1. (The look of the interface is not important)</p>

<p><img src="https://i.stack.imgur.com/Q3N2q.png" alt="Figure 1: What I would like to get"></p>

<p>Currently, I am able to get figure 2 using the code presented <a href="https://stackoverflow.com/questions/3579568/choosing-a-file-in-python-with-simple-dialog">here</a>:</p>

<pre><code>from Tkinter import Tk
from tkFileDialog import askopenfilename

Tk().withdraw() 
filename = askopenfilename()
print(filename)
</code></pre>

<p><img src="https://i.stack.imgur.com/Tt3P0.png" alt="Figure 2: What I currently have"></p>

<p>Research has indicated that it is not possible to change the default buttons in Tkinter windows. Is this true? If it can’t be done with Tkinter (and that’s fine), how else can we do it?</p>

<p>I’d happily choose simple, non-Tkinter code (perhaps using wxPython’s <code>wx.GenericDirCtrl()</code>) rather than elaborate Tkinter code, but no restrictive libraries please.</p>

<p>A modular design approach is not needed. I’d rather have simple (functional) code that is shorter than object-oriented code.</p>