Hello,
I have the path of a certain folder. I want to open it using the default
folder explorer for that system. For example, if it's a Windows computer, I
want to use Explorer, if it's Linux, I want to use Nautilus or whatever is
the default there, if it's Mac, I want to use whatever Mac OS's explorer is
called.
I asked this on StackOverflow:
http://stackoverflow.com/questions/6631299/python-opening-a-folder-in-explo…
But it seems that Python doesn't offer a cross-platform way to do this. …
[View More]I
see this functionality as pretty similar to that of the `webbrowser` module.
Do you think that this is something that could be included with the standard
library?
Ram.
[View Less]
Hello all,
Occasionally I build up tuples of types for passing as the second argument
to isinstance. I've noticed on occasions having duplicates, for example the
following code is Python 2 & 3 compatible but results in a duplicate on one
of them:
FunctionTypes = (
# python function
type(create_autospec),
# instance method
type(ANY.__eq__),
# unbound method
type(_ANY.__eq__),
)
It would feel cleaner to me if I could make FunctionTypes a set and use that
as the …
[View More]second argument to isinstance. :-)
Michael
--
http://www.voidspace.org.uk/
May you do good and not evil
May you find forgiveness for yourself and forgive others
May you share freely, never taking more than you give.
-- the sqlite blessing http://www.sqlite.org/different.html
[View Less]
Often when exploring an object with the 'dir' function, particularly in
large packages like SciPy, I find that I need to filter the outout.
Since a dir reminds me of a dos 'dir' or linux 'ls', a glob feels like
the most natural to use.
For example, none of these would work:
>>> dir(sp.fft.i*) # syntax error
>>> dir('sp.fft.i*') # returns the attributes a string
I believe a new dir functions is needed, or a change in the behviour of
the current version.
Of course a '…
[View More]glob aware dir function' can be implemented by monitoring
the call stack (cf. sys._getframe().f_back), but I think the problem is
general enough to warrant an official sultion.
Sturla
[View Less]