views:

31

answers:

1

I am using following code to open a folder in default file browser.

if os.name == 'mac':
  subprocess.call(('open', folderPath))
elif os.name == 'nt':
  subprocess.call(('start', folderPath))
elif os.name == 'posix':
  subprocess.call(('xdg-open', folderPath))

Now the problem is I want to highlight the child folder/file which was selected earlier. Is there any way to do it? If not for all, at least for nautilus?

+1  A: 

xdg-open doesn't support this, so it has to be done on a per-app basis. After poking around the Nautilus code, I don't think it has this feature either. So, yeah, you're pretty much out of luck.

For Windows Explorer, you can use

subprocess.call(("explorer", "/select,", file_path))
Johannes Sasongko
Thanks Johannes, After searching a lot I feel the same :(
Myth