FileDialog wildcard & file without extension

192 views
Skip to first unread message

Fabio Spadaro

unread,
Jul 23, 2009, 4:02:59 PM7/23/09
to wxPytho...@googlegroups.com
Hi all.
in a file dialog i would have to show the file without extensions.
These files are sqlite databases that have no extension.
in wildcard options there is "All files (*.*)|*.*" but I do not see any files.
How can I do?
...
wildcard = "All files (*.*)|*.*"
dialog = wx.FileDialog(None, "Choose a file", os.getcwd(),
"", wildcard, wx.OPEN)

--
Fabio
www.fabiospadaro.com

Cody Precord

unread,
Jul 23, 2009, 4:07:58 PM7/23/09
to wxPytho...@googlegroups.com
Hello,

Instead of *.* just use *

i.e) "All Files (*)|*"

*.* means anything.anything
* mean anything

Cody

Fabio Spadaro

unread,
Jul 23, 2009, 4:13:05 PM7/23/09
to wxPytho...@googlegroups.com
great.
was obvious and I had not thought about this.
thanks :)

2009/7/23 Cody Precord <codyp...@gmail.com>:
--
Fabio
www.fabiospadaro.com

Steven Sproat

unread,
Jul 23, 2009, 5:03:23 PM7/23/09
to wxPytho...@googlegroups.com

Strange - in my application, I'm using "*.*" as my any filter, and I
renamed a file to a blank extension and it still showed; Windows XP SP3,
python 2.5 wx 2.8.10.1

Shoola

unread,
Jul 24, 2009, 4:27:52 AM7/24/09
to wxPython-users
not strange:

in windows, *.* is a tricky expression, meaning also "filenames with
or without a dot".

this may have been left for backward compatibility, since in the "old
days" when file extensions were mandatory (e.g. DOS).

in any case, windows and linux behave differently.
you might want this string to be parametric, e.g.
if sys.platform==...


On Jul 24, 12:03 am, Steven Sproat <spro...@gmail.com> wrote:
> Fabio Spadaro wrote:
> > great.
> > was obvious and I had not thought about this.
> > thanks :)
>
> > 2009/7/23 Cody Precord <codyprec...@gmail.com>:
>
> >> Hello,

Robin Dunn

unread,
Jul 24, 2009, 1:03:45 PM7/24/09
to wxPytho...@googlegroups.com
Steven Sproat wrote:

> Strange - in my application, I'm using "*.*" as my any filter, and I
> renamed a file to a blank extension and it still showed; Windows XP SP3,
> python 2.5 wx 2.8.10.1

Because of the the way that the legacy FAT file system works (back when
there was only 8.3 file names) a "*.*" on Windows is essentially the
same as "*" on other systems. IOW the "." does not have to actually
exist in the name. This is because in the early days of CP/M and DOS
files had both a name and an extension, not just a name that may or may
not have a dot in it followed by a few more characters.

So to be perfectly compliant with platform standards, you should
probably check the platform and use "*.*" on Windows and "*" on the
other platforms when you want to specify "any" file.

--
Robin Dunn
Software Craftsman
http://wxPython.org

Reply all
Reply to author
Forward
0 new messages