473,394 Members | 1,701 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,394 software developers and data experts.

wxPython FileDialog, select folder

How can i select folder either with wx.FileDialog or with any other. I
managed to fine only how to open files but I need to select folder to
get files from all sub folders.....

Thanks in advance!

Dec 20 '07 #1
5 7738
On Dec 20, 2007 3:19 PM, SMALLp <po***@email.t-com.hrwrote:
How can i select folder either with wx.FileDialog or with any other. I
managed to fine only how to open files but I need to select folder to
get files from all sub folders.....

There's a separate dialog, wx.DirDialog.
Dec 20 '07 #2
Chris Mellon wrote:
On Dec 20, 2007 3:19 PM, SMALLp <po***@email.t-com.hrwrote:
>How can i select folder either with wx.FileDialog or with any other. I
managed to fine only how to open files but I need to select folder to
get files from all sub folders.....


There's a separate dialog, wx.DirDialog.
Now I cant find where I've seen how to get directory listing with
premissions (-rw-...and this).
Dec 20 '07 #3
import wx
def dirchoose():
'Gives the user selected path. Use: dirchoose()'
global _selectedDir , _userCancel #you should define
them before
userPath = 'c:/'
app = wx.App()
dialog = wx.DirDialog(None, "Please choose your project directory:",\
style=1 ,defaultPath=userPath, pos = (10,10))
if dialog.ShowModal() == wx.ID_OK:
_selectedDir = dialog.GetPath()
return _selectedDir
else:
#app.Close()
dialog.Destroy()
return _userCancel

Cheers, Farsheed.
Dec 20 '07 #4
farsheed wrote:
import wx
def dirchoose():
'Gives the user selected path. Use: dirchoose()'
global _selectedDir , _userCancel #you should define
them before
userPath = 'c:/'
app = wx.App()
dialog = wx.DirDialog(None, "Please choose your project directory:",\
style=1 ,defaultPath=userPath, pos = (10,10))
if dialog.ShowModal() == wx.ID_OK:
_selectedDir = dialog.GetPath()
return _selectedDir
else:
#app.Close()
dialog.Destroy()
return _userCancel

Cheers, Farsheed.
Thanks! I've already figured it out from first reply. Now i get selected
directory and i want to get all directories from thin directory. I found
os.listdir but it oly gets names of files and i nedd output with
permisions e.g. -rw-r--r-- 1 pofuk pofuk 105 2007-12-19 21:59 login.py
Dec 20 '07 #5
SMALLp <po***@email.t-com.hrwrote:
>
Thanks! I've already figured it out from first reply. Now i get selected
directory and i want to get all directories from thin directory. I found
os.listdir but it oly gets names of files and i nedd output with
permisions e.g. -rw-r--r-- 1 pofuk pofuk 105 2007-12-19 21:59 login.py
Do you want to KNOW the permissions, or do you really want to get the
output of "ls -l"?

What you probably want is os.walk. You can call stat or os.path.isdir to
get information about the files you discover.
--
Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Dec 23 '07 #6

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

Similar topics

0
by: Anand Pillai | last post by:
Hi I am using wxPython version 2.4.0.1. When using wxFileDialog to save files, the filename returned is *always* the extension of the first entry in the wildcard. That is if my wildcard...
3
by: John Field | last post by:
Hello, Is it possible to exclude certain files in a wx.FileDialog, so that the user won't see them and can't select them with the mouse in de File open window? I was thinking of somehow...
2
by: Iain King | last post by:
I can't get these to work, and I can't work out what I'm doing wrong. I added the following lines to the GenericDirCtrl.py demo in the wxython demos folder: at the end TestPanel.__init__ I...
1
by: kath | last post by:
Hello, sorry about the lengthy message. I finding difficult to execute this program. The wx.Notebook i created is coming on the splitted frame(self.p2). How do I that. I am started to learn...
2
jamjar
by: jamjar | last post by:
I am trying to use the SaveAs type FileDialog to allow the user to enter a file name. It's only letting me choose exisiting files. Is there any way to use the FileDialog to allow the user to select...
8
by: Janwillem | last post by:
Is there a way to force the wx.FileDialog to show as default the thumbnails vie in stead of list view? thanks, janwillem
3
tdw
by: tdw | last post by:
I have a working hyperlink field in a table, and it's form. I also have a working File Picker Dialog: FileDialog(msoFileDialogFilePicker), being used to create the hyperlink. What I need to do, and...
6
by: Iain King | last post by:
Hi. I have a modal dialog whcih has a "Browse..." button which pops up a file selector. This all works fine, but the first thing the user has to do when they open the dialog is select a file, so...
2
by: AccessHunter | last post by:
Hi, Below is the VB code I am using to let users select the folder they want to save a file.My problem is once user selects a folder, none of the files in that folder is displayed. I understand it...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.