Python Tutorial: OS Module - Use Underlying Operating System Functionality

preview_player
Показать описание
In this Python Tutorial, we will be going over the 'os' module. The os module allows us to access functionality of the underlying operating system. So we can perform tasks such as: navigate the file system, obtain file information, rename files, search directory trees, fetch environment variables, and many other operations. We will cover a lot of what the os module has to offer in this tutorial, so let's get started.

✅ Support My Channel Through Patreon:

✅ Become a Channel Member:

✅ One-Time Contribution Through PayPal:

✅ Cryptocurrency Donations:
Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33
Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot

✅ Corey's Public Amazon Wishlist

✅ Equipment I Use and Books I Recommend:

▶️ You Can Find Me On:

#Python
Рекомендации по теме
Комментарии
Автор

+ os.getcwd() => get current working directory
+ os.chdir(<path>) => change directory
+ os.listdir() => list directory
+ os.mkdir(<dirname>) => create a directory
+ os.makedirs(<dirname>) => make directories recursively
+ os.rmdir(<dirname>) => remove directory
+ os.removedirs(<dirname>) => remove directory recursively
+ os.rename(<from>, <to>) => rename file
+ os.stat(<filename>) => print all info of a file
+ os.walk(<path>) => traverse directory recursively
+ os.environ => get environment variables
+ os.path.join(<path>, <file>) => join path without worrying about /
+ os.path.basename(<filename>) => get basename
+ os.path.dirname(<filename>) => get dirname
+ => check if the path exists or not
+ => split path and file extension
+ dir(os) => check what methods exists

shreyaschavhan
Автор

its so sad that this guy has not uploaded any content for over a year now... his tutorials are always the best, most methodically thought out pieces of work on the platform

dev_soda
Автор

It is very excellent tutorial, much better than some paid python tutorial vedios in Udemy
for i in
print('Thank you so much for sharing this wonderful tutorial')

chuanliangjiang
Автор

A tutorial for the sys module would help tremendously. It's difficult to find someone like you who can explain things in such detail as well as show how useful certain things within python can be without half-assing it. Thanks, Corey.

codaadoc
Автор

Bless your soul Corey! The os module has always been such a pain to learn. When you first see it in code it's so cryptic. Thanks for breaking it down for us!

jordangillard
Автор

The best one i have ever seen in teaching coding . Thank you so much man

khaled-dz
Автор

every time I need a tutorial video for Python, Corey is always the best one with really well organized, fully information and easily to remember. Thanks a lot Corey

bactran
Автор

These Python videos are extremely helpful, thank you. I would be grateful if you added chapters. Some of the 10 minute plus videos have a lot of concepts and it would be great to jump back into a specific section when in need of a refresher. Keep up the excellent work and stay Pythonic my friend.

knownwolf
Автор

You are very good at explaining Python modules and their practical uses.

salkdjfasldkfjsdlk
Автор

For windows users, print (os.environ.get("HOME")) won't work as there is no HOME folder, instead it is USERPROFILE. So, type USERPROFILE instead of HOME.

sreedharIITR
Автор

I never read your descriptions, but after seeing what's on your amazons' wish list, I can tell, you aint no ordinary tutor. Respect. Sharp, evolving mind.

yomajo
Автор

you are much better than my faculty handling python course....

sahajjaiswal
Автор

please make one tutorial for sys module as well... :-)

veeresharadhya
Автор

for Windows users I used HOMEPATH instead of Home, use SET Command to be able to see all environment variables on CMD

sujithnair
Автор

I was surprised how quick that search was wth os.walk().... and at the same time, wondered why Windows "Find" takes so long. Thanks for the great teachings.

turboromy
Автор

It is so demonstrating that you can hardly find any questions in the comments - there are only thanks and insparations 😏 The explanation is so clear that it leaves nothing to ask about 💎 Great job 👍

qnbyivu
Автор

I've been learning python for several months now, and not once did i ever see anything about print(dir(<module>))! Like given!

zacharysimpson
Автор

Simple, well organized, great for beginners and informative. Nothing but least speaks English doesn't try to showoff.

GihanJayaneththie
Автор

Corey, I hope you are well today. 🤙🤙 I have been sober for one year. We got this.

JoyDavidson
Автор

I love Corey's teaching ... and accent!

erfantaghvaei