Nice Video! It feels like glob rules and regex is pretty much the same, but there are actually many differences. The strange thing is you don't notice them when working in the domain of directiories, so it feels very natural to use the glob rules. The whole video I was thinking "Wait what is different from regular expressions here?"
Test is important but it can be misleading. It's good to check the documentation always! The second line docs of "glob.glob(pathname, *, root_dir=None, dir_fd=None, recursive=False, include_hidden=False)" contains the answer. Typing the answer was longer than googling the docs and checking the possible path types... :( It is your turn, find the docs instead of asking in comment! ;)
I’ve transitioned to only using Path.glob() since often I need to import Path anyway, and now I need 1 fewer import. I basically never import glob anymore
Yes! I just transitioned to pathlib this week after resisting forever. What sold me was using the division operator “/“ instead of os.path.join all the time. Now I realize that I often don’t need os, sys, and glob imports.
It works very well for current disc directory,but when I try different disc and capital letters folder it gives me this error: root_dir='D:\MY DOCUMENTS\NIZAR', ^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 15-16: malformed \N character escape
I have been using glob for a long time, but I only knew the * notation, so really insightful video as always! I do have to change a lot of my code now tho :/
@@davidlioner4332 while that is true. Python doesn't really have the tradition concept of private methods. Dunder methods are the closest to it. If it was truly private, the call wouldn't even work. The point still stands.
Ananas is pineapple in my language. Hmmm. Awesome video live your content I recently found ya and subbed
Ananas is pineapple in many languages, the English pineapple being the anomaly
@@Rizzstechindeed correct. strange how english is like this 😆
In mine it's anarosch and I'm bangali
Not that weird. In spanish it is piña
@@s.a.2571 yet the South America countries that speak Spanish also use ananas
Nice Video! It feels like glob rules and regex is pretty much the same, but there are actually many differences. The strange thing is you don't notice them when working in the domain of directiories, so it feels very natural to use the glob rules. The whole video I was thinking "Wait what is different from regular expressions here?"
The biggest difference is that the dot is not an "any character" symbol
Man, I like your videos very much. Great work!
Very informative! thanks for the wonderful content ,explained in eloquent manner.
Very handy. Thanks. Can you start the search from, say, '../' or '../../' like you can in the shell? Or do you need an absolute path?
You can try such trivial things on your own computer. And see if it works.
Test is important but it can be misleading.
It's good to check the documentation always!
The second line docs of "glob.glob(pathname, *, root_dir=None, dir_fd=None, recursive=False, include_hidden=False)" contains the answer.
Typing the answer was longer than googling the docs and checking the possible path types... :(
It is your turn, find the docs instead of asking in comment! ;)
Thanks so much. Saved me so much manual work!!!
been using subprocess to do the same thing, glad youtube algorithm showed me this :D
Thank you. Didn't know about "iglob". It will help you at work.
Your videos are all freaking fantastic
Excellent video. Thanks!
Thank you, I really learn from your videos
I’ve transitioned to only using Path.glob() since often I need to import Path anyway, and now I need 1 fewer import. I basically never import glob anymore
Yes! I just transitioned to pathlib this week after resisting forever. What sold me was using the division operator “/“ instead of os.path.join all the time. Now I realize that I often don’t need os, sys, and glob imports.
which code editor you are using?
print('Thanks a lot!!')
Thanks Sir for your Guidance
It works very well for current disc directory,but when I try different disc and capital letters folder it gives me this error:
root_dir='D:\MY DOCUMENTS\NIZAR',
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 15-16: malformed \N character escape
I have been using glob for a long time, but I only knew the * notation, so really insightful video as always!
I do have to change a lot of my code now tho :/
Great video thanks
Use next(globs) instead of globs.__next__(). Calling private functions outside the class is bad practice.
Dunders methods != private methods
@@davidlioner4332 while that is true. Python doesn't really have the tradition concept of private methods. Dunder methods are the closest to it. If it was truly private, the call wouldn't even work.
The point still stands.
nice video. learned allot
Great video
I just found glob randomly in python and i dont know what to do with it
We all come across that moment ahah
Awesome one
Cool, have not known before.
Ananas is ananas in my language 😉
Glob
Hi! Cool tutorial.Just one sa=mall query can we use this to list all objects from an S3 Bucket?
Grande fede Grazie!
oh my glob
That was exactly my reaction
GLOB
Mcoding like thumbnail
Where Banana? Me sad no see banana ;(
Ma un video in italiano quando lo farai?
boh :)
@@Indently daje!!
I always favor regex over glob, I don't like glob really much
They do different jobs though, no?
WHAT, not wtf. Have some class.
You can have a class for this if you want, that’s up to you.
Hello Idently! Unfortunately I'm having this error, whe i run this code:
CODE:
import glob, pandas as pd, os
print(glob.glob("**/*.pdf", path = 'C:\Users
dofi.vontade\OneDrive\Ndofi\Analytics\DB', recursive=True, includ_hiden=True))
ERROR:
Input In [140]
print(glob.glob("**/*.pdf", path = 'C:\Users
dofi.vontade\OneDrive\Ndofi\Analytics\DB', recursive=True, includ_hiden=True))
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
I won't be coding any time soon so video doesn't apply to me :(
Great video