From 247c2e29672d58ac3751e27db64a9d52d6862629 Mon Sep 17 00:00:00 2001 From: Paul McCarthy <pauldmccarthy@gmail.com> Date: Thu, 15 Feb 2018 11:55:17 +0000 Subject: [PATCH] Note in file management prac --- getting_started/03_file_management.ipynb | 8 ++++++++ getting_started/03_file_management.md | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/getting_started/03_file_management.ipynb b/getting_started/03_file_management.ipynb index b9d93b6..3aa9736 100644 --- a/getting_started/03_file_management.ipynb +++ b/getting_started/03_file_management.ipynb @@ -805,6 +805,14 @@ " and `fnmatch.filter` functions to identify which paths match your pattern.\n", "\n", "\n", + "Note that the syntax used by `glob` and `fnmatch` is similar, but __not__\n", + "identical to the syntax that you are used to from `bash`. Refer to the\n", + "[`fnmatch` module](https://docs.python.org/3.5/library/fnmatch.html)\n", + "documentation for details. If you need more complicated pattern matching, you\n", + "can use regular expressions, available via the [`re`\n", + "module](https://docs.python.org/3.5/library/re.html).\n", + "\n", + "\n", "For example, let's retrieve all images that are in our data set:" ] }, diff --git a/getting_started/03_file_management.md b/getting_started/03_file_management.md index 73527ca..614425b 100644 --- a/getting_started/03_file_management.md +++ b/getting_started/03_file_management.md @@ -615,8 +615,17 @@ pattern matching logic. and `fnmatch.filter` functions to identify which paths match your pattern. +Note that the syntax used by `glob` and `fnmatch` is similar, but __not__ +identical to the syntax that you are used to from `bash`. Refer to the +[`fnmatch` module](https://docs.python.org/3.5/library/fnmatch.html) +documentation for details. If you need more complicated pattern matching, you +can use regular expressions, available via the [`re` +module](https://docs.python.org/3.5/library/re.html). + + For example, let's retrieve all images that are in our data set: + ``` allimages = glob(op.join('raw_mri_data', '**', '*.nii*'), recursive=True) print('All images in experiment:') -- GitLab