Reputation: 157
I use jupyter notebook anaconda, I need to read paths of specific files from folder
paths = glob.glob('E:\master\neural network\mit-bih-arrhythmia-database-1.0.0/*.atr', recursive=True)
paths = glob.glob('E:\master\neural network\mit-bih-arrhythmia-database-1.0.0/*.atr')
**paths = glob.glob('E:\master\neural network\mit-bih-arrhythmia-database-1.0.0\*.atr')**
I try these lines but paths returns empty
Upvotes: 0
Views: 253
Reputation: 27567
You need double backslashes because they're special characters:
paths = glob.glob('E:\\master\\neural network\\mit-bih-arrhythmia-database-1.0.0\\*.atr', recursive=True)
You can also use an r
string instead, so that all the characters will be interpreted as normal:
paths = glob.glob(r'E:\master\neural network\mit-bih-arrhythmia-database-1.0.0\*.atr', recursive=True)
Upvotes: 1