Update README.md

Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com>
This commit is contained in:
David Rotermund 2023-12-02 02:09:42 +01:00 committed by GitHub
parent c6bbdfa1df
commit 1d57978583
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,3 +16,35 @@ Path("Testfile_010.mat").touch()
Path("Testfile_003.mat").touch()
```
## Using glob in a for-loop
```python
import glob
for filename in glob.glob("*.mat"):
print(filename)
```
```python console
Testfile_001.mat
Testfile_002.mat
Testfile_010.mat
Testfile_003.mat
```
## Using glob to create a list
```python
import glob
list = glob.glob("*.mat")
print(list)
```
```python console
['Testfile_001.mat', 'Testfile_002.mat', 'Testfile_010.mat', 'Testfile_003.mat']
```