Skip to content

Instantly share code, notes, and snippets.

@thoroc
Last active March 25, 2021 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thoroc/42a490ab76d18740236e6863bade9243 to your computer and use it in GitHub Desktop.
Save thoroc/42a490ab76d18740236e6863bade9243 to your computer and use it in GitHub Desktop.
show how to open nautilus (linux file explorer) from a Jupyter Notebook
import subprocess
output_path = Path('output')
list_files = [f.name for f in output_path.iterdir() if f.is_file() and f.suffix == f'.csv']
for f in list_files:
if my_file in f:
print(f'found the file: {f}')
dir_path = Path(Path.cwd(), output_path)
subprocess.call(['nautilus', dir_path])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment