473,408 Members | 2,399 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,408 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 7744
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.