473,387 Members | 1,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Widget that displays a directory tree?

Do any of the Python GUIs have a super-high-level widget that displays a
directory tree? Most file managers or editors have this type of window.
Jan 12 '06 #1
6 8539
On Thu, 12 Jan 2006 11:55:46 -0500, "Edward C. Jones"
<ed******@comcast.net> wrote:
Do any of the Python GUIs have a super-high-level widget that displays a
directory tree? Most file managers or editors have this type of window.

Look at the wxPython Demo:

There is the GenericDirCtrl and (especially for Windows)
the GenericWinDirCtrl.

Screenshots of both at:

http://wiki.wxpython.org/index.cgi/GenericWinDirCtrl
--
Franz Steinhaeusler
Jan 12 '06 #2
On Thursday 12 January 2006 4:55 pm, Edward C. Jones wrote:
Do any of the Python GUIs have a super-high-level widget that displays a
directory tree? Most file managers or editors have this type of window.


Below is the dirview.py example from the soon-to-be-released PyQt4. Snapshots
are available, including a GPL binary package for Windows for use with the
GPL version of Qt.

Phil
import sys
from PyQt4 import QtCore, QtGui

app = QtGui.QApplication(sys.argv)

model = QtGui.QDirModel()
tree = QtGui.QTreeView()
tree.setModel(model)

tree.setWindowTitle(tree.tr("Dir View"))
tree.resize(640, 480)
tree.show()

sys.exit(app.exec_())
Jan 12 '06 #3
On Thu, 12 Jan 2006 11:55:46 -0500, rumours say that "Edward C. Jones"
<ed******@comcast.net> might have written:
Do any of the Python GUIs have a super-high-level widget that displays a
directory tree? Most file managers or editors have this type of window.


If you have idle installed, you can check the PathBrowser.py file in your
idlelib directory. (Run idle; click File -> Path Browser to see it in
action, and click File -> Open Module -> PathBrowser -> OK to see/edit the
source).
--
TZOTZIOY, I speak England very best.
"Dear Paul,
please stop spamming us."
The Corinthians
Jan 16 '06 #4
Christos Georgiou wrote:
On Thu, 12 Jan 2006 11:55:46 -0500, rumours say that "Edward C. Jones"
<ed******@comcast.net> might have written:

Do any of the Python GUIs have a super-high-level widget that displays a
directory tree? Most file managers or editors have this type of window.

If you have idle installed, you can check the PathBrowser.py file in your
idlelib directory. (Run idle; click File -> Path Browser to see it in
action, and click File -> Open Module -> PathBrowser -> OK to see/edit the
source).


C:\>C:\Python24\python.exe
Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on
win32
C:\>C:\Python24\Lib\idlelib\PathBrowser.py
Traceback (most recent call last):
File "C:\Python24\Lib\idlelib\PathBrowser.py", line 95, in ?
main()
File "C:\Python24\Lib\idlelib\PathBrowser.py", line 90, in main
PathBrowser(PyShell.flist)
AttributeError: 'module' object has no attribute 'flist'

Strange ...

Claudio
Jan 16 '06 #5
Claudio Grondi wrote:
Christos Georgiou wrote:
On Thu, 12 Jan 2006 11:55:46 -0500, rumours say that "Edward C. Jones"
<ed******@comcast.net> might have written:

Do any of the Python GUIs have a super-high-level widget that displays a
directory tree? Most file managers or editors have this type of window.

If you have idle installed, you can check the PathBrowser.py file in your
idlelib directory. (Run idle; click File -> Path Browser to see it in
action, and click File -> Open Module -> PathBrowser -> OK to see/edit the
source).


C:\>C:\Python24\python.exe
Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on
win32
C:\>C:\Python24\Lib\idlelib\PathBrowser.py
Traceback (most recent call last):
File "C:\Python24\Lib\idlelib\PathBrowser.py", line 95, in ?
main()
File "C:\Python24\Lib\idlelib\PathBrowser.py", line 90, in main
PathBrowser(PyShell.flist)
AttributeError: 'module' object has no attribute 'flist'

Strange ...


in what way?

the instructions you didn't read told you to run idle, and select the
browser via the menu system to see it in action.

</F>

Jan 16 '06 #6
Fredrik Lundh wrote:
Claudio Grondi wrote:

Christos Georgiou wrote:
On Thu, 12 Jan 2006 11:55:46 -0500, rumours say that "Edward C. Jones"
<ed******@comcast.net> might have written:

Do any of the Python GUIs have a super-high-level widget that displays a
directory tree? Most file managers or editors have this type of window.
If you have idle installed, you can check the PathBrowser.py file in your
idlelib directory. (Run idle; click File -> Path Browser to see it in
action, and click File -> Open Module -> PathBrowser -> OK to see/edit the
source).


C:\>C:\Python24\python.exe
Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on
win32
C:\>C:\Python24\Lib\idlelib\PathBrowser.py
Traceback (most recent call last):
File "C:\Python24\Lib\idlelib\PathBrowser.py", line 95, in ?
main()
File "C:\Python24\Lib\idlelib\PathBrowser.py", line 90, in main
PathBrowser(PyShell.flist)
AttributeError: 'module' object has no attribute 'flist'

Strange ...

in what way?

the instructions you didn't read told you to run idle, and select the
browser via the menu system to see it in action.

</F>

Yes, you are right. The section
def main():
import PyShell
PathBrowser(PyShell.flist)
if sys.stdin is sys.__stdin__:
mainloop()
in PathBrowser.py suggested (apparent falsely), that it should run also
standalone - that was my problem.
Thank you.

Claudio
Jan 16 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Jane Austine | last post by:
As you add more items, say text lines, in Text widget, it gets too slow and almost impractical to use on. Take idle for example. If the text gets bigger(e.g. print...
2
by: Srinath Avadhanula | last post by:
Hello, Sorry to be bringing up what seems to be a somewhat beaten up topic... This is what I wanted to do: Create a _simple_ text editor widget which supports VI(M) style keybindings but...
0
by: Sylwia | last post by:
Hi! Have anyone ever tried to modify the Gene Cash's Tkinter tree widget (available from http://home.cfl.rr.com/genecash/) so it supports multiple items selection ( selection of multiple files...
3
by: Sean McIlroy | last post by:
I'm looking for a widget, to be used with Tkinter, that displays a tree whose leaves are strings. I thought there was something like that in the Python Megawidgets, but when I look at the...
6
by: William Gill | last post by:
I am trying to get & set the properties of a widget's parent widget. What I have works, but seems like a long way around the block. First I get the widget name using w.winfo_parent(), then i...
3
by: _DS | last post by:
Problem with mapping a directory tree to a tree control: It takes a while to recurse subdirs and map them to nodes. This is solved in some books I've seen (MacDonald, Albahari) by reading the...
0
by: Tim N. van der Leeuw | last post by:
Hi, I need to display some hierarchical data, and because I don't want to force users to install too many things beyond Python itself, I'm hoping to use Tix which is at least included with...
1
by: aeroumr | last post by:
In the following code, I have created a panel with a button and a textctrl object on it. I have also created a menubar that will create a new text file (i.e. textctrl object). My problem is that...
13
by: lawpoop | last post by:
Hello all - I have a two part question. First of all, I have a website under /home/user/www/. The index.php and all the other website pages are under /home/user/www/. For functions that are...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.