WHAT Is "Glob" In Python?! (It's Actually Very Useful!)

  Рет қаралды 38,566

Indently

Indently

Жыл бұрын

WTF is the glob module in Python, and how can we use it in our code?
▶ Become job-ready with Python:
www.indently.io
▶ Follow me on Instagram:
/ indentlyreels

Пікірлер: 66
@grzegorzryznar5101
@grzegorzryznar5101 Жыл бұрын
Man, I like your videos very much. Great work!
@SabahMahjabeenSarwar
@SabahMahjabeenSarwar Ай бұрын
Very informative! thanks for the wonderful content ,explained in eloquent manner.
@himalkarkal6355
@himalkarkal6355 3 ай бұрын
Thanks so much. Saved me so much manual work!!!
@dcollett
@dcollett Жыл бұрын
Excellent video. Thanks!
@chalkypj
@chalkypj Жыл бұрын
Thank you, I really learn from your videos
@barelycodingtoday
@barelycodingtoday Жыл бұрын
Your videos are all freaking fantastic
@Lord_Shan
@Lord_Shan Жыл бұрын
Thank you. Didn't know about "iglob". It will help you at work.
@blevenzon
@blevenzon Жыл бұрын
Ananas is pineapple in my language. Hmmm. Awesome video live your content I recently found ya and subbed
@Rizzstech
@Rizzstech Жыл бұрын
Ananas is pineapple in many languages, the English pineapple being the anomaly
@tfr
@tfr Жыл бұрын
@@Rizzstechindeed correct. strange how english is like this 😆
@hamzabiswas8632
@hamzabiswas8632 Жыл бұрын
In mine it's anarosch and I'm bangali
@s.a.2571
@s.a.2571 Жыл бұрын
Not that weird. In spanish it is piña
@Rizzstech
@Rizzstech Жыл бұрын
@@s.a.2571 yet the South America countries that speak Spanish also use ananas
@chrislione950
@chrislione950 6 күн бұрын
Great video thanks
@RonaldPostelmans
@RonaldPostelmans Жыл бұрын
nice video. learned allot
@SACHINKUMAR-px8kq
@SACHINKUMAR-px8kq Жыл бұрын
Thanks Sir for your Guidance
@turboblitz4587
@turboblitz4587 Жыл бұрын
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?"
@kreuner11
@kreuner11 Жыл бұрын
The biggest difference is that the dot is not an "any character" symbol
@travisweedon1234
@travisweedon1234 Жыл бұрын
Man you are great!
@KaFuMan
@KaFuMan Жыл бұрын
been using subprocess to do the same thing, glad youtube algorithm showed me this :D
@karthikd469
@karthikd469 Жыл бұрын
Awesome one
@nextisnowmain
@nextisnowmain 3 ай бұрын
Great video
@FilosofoDaCamera
@FilosofoDaCamera Жыл бұрын
Grande fede Grazie!
@UCSAmit
@UCSAmit Жыл бұрын
which code editor you are using?
@rantalbott6963
@rantalbott6963 Жыл бұрын
Very handy. Thanks. Can you start the search from, say, '../' or '../../' like you can in the shell? Or do you need an absolute path?
@md.masumomarjashim
@md.masumomarjashim Жыл бұрын
You can try such trivial things on your own computer. And see if it works.
@piiissz
@piiissz Жыл бұрын
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! ;)
@oleksandershevchenko8063
@oleksandershevchenko8063 3 ай бұрын
Cool, have not known before. Ananas is ananas in my language 😉
@INGIE32
@INGIE32 Жыл бұрын
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 :/
@peshotod
@peshotod 5 ай бұрын
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
@GATEPREP
@GATEPREP Жыл бұрын
Hi! Cool tutorial.Just one sa=mall query can we use this to list all objects from an S3 Bucket?
@allo5668
@allo5668 Жыл бұрын
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
@thatsunpossible312
@thatsunpossible312 Жыл бұрын
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.
@qondonyon
@qondonyon Жыл бұрын
Glob
@duerdum9
@duerdum9 Жыл бұрын
Use next(globs) instead of globs.__next__(). Calling private functions outside the class is bad practice.
@davidlioner4332
@davidlioner4332 Жыл бұрын
Dunders methods != private methods
@duerdum9
@duerdum9 Жыл бұрын
@@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.
@troy5553
@troy5553 Жыл бұрын
I just found glob randomly in python and i dont know what to do with it
@Indently
@Indently Жыл бұрын
We all come across that moment ahah
@scullyy
@scullyy Жыл бұрын
oh my glob
@Indently
@Indently Жыл бұрын
That was exactly my reaction
@vbxiv5553
@vbxiv5553 7 ай бұрын
GLOB
@Luclecool123
@Luclecool123 Жыл бұрын
Mcoding like thumbnail
@newcoolboys
@newcoolboys Жыл бұрын
Where Banana? Me sad no see banana ;(
@gund4m
@gund4m Жыл бұрын
Ma un video in italiano quando lo farai?
@Indently
@Indently Жыл бұрын
boh :)
@gund4m
@gund4m Жыл бұрын
@@Indently daje!!
@zangdaarrmortpartout
@zangdaarrmortpartout Жыл бұрын
I always favor regex over glob, I don't like glob really much
@Indently
@Indently Жыл бұрын
They do different jobs though, no?
@Gruuvin1
@Gruuvin1 Жыл бұрын
WHAT, not wtf. Have some class.
@Indently
@Indently Жыл бұрын
You can have a class for this if you want, that’s up to you.
@Ndofi
@Ndofi Жыл бұрын
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
@ksspqf6016
@ksspqf6016 Жыл бұрын
I won't be coding any time soon so video doesn't apply to me :(
@davizek9047
@davizek9047 Жыл бұрын
print('Thanks a lot!!')
@user-pm6qt6ee7p
@user-pm6qt6ee7p 4 ай бұрын
Great video
6 CLEAN Tips To IMPROVE Your Python Functions
9:55
Indently
Рет қаралды 73 М.
5 Really Cool Python Functions
19:58
Indently
Рет қаралды 55 М.
버블티로 체감되는 요즘 물가
00:16
진영민yeongmin
Рет қаралды 115 МЛН
THEY made a RAINBOW M&M 🤩😳 LeoNata family #shorts
00:49
LeoNata Family
Рет қаралды 32 МЛН
THE POLICE TAKES ME! feat @PANDAGIRLOFFICIAL #shorts
00:31
PANDA BOI
Рет қаралды 24 МЛН
How I would learn to code (if I could start over)
10:52
PIRATE KING
Рет қаралды 1,3 МЛН
5 Uncommon Python Features I Love
15:09
Indently
Рет қаралды 137 М.
How To Use List Comprehension In Python
6:41
Taylor's Software
Рет қаралды 6 М.
Hashing in Python: Using Hashlib Library for Secure Hashing
15:42
5 Good Python Habits
17:35
Indently
Рет қаралды 418 М.
Modern Python logging
21:32
mCoding
Рет қаралды 160 М.
ALL 47 STRING METHODS IN PYTHON EXPLAINED
23:34
Indently
Рет қаралды 120 М.
Python 101: Learn the 5 Must-Know Concepts
20:00
Tech With Tim
Рет қаралды 1,1 МЛН
CONCURRENCY IS NOT WHAT YOU THINK
16:59
Core Dumped
Рет қаралды 89 М.
WHAT Is "Pickle" In Python?! (EXTREMELY Useful!)
9:32
Indently
Рет қаралды 76 М.
버블티로 체감되는 요즘 물가
00:16
진영민yeongmin
Рет қаралды 115 МЛН