- 64
- 111 057
Jake Callahan
United States
เข้าร่วมเมื่อ 8 ต.ค. 2013
Principal Software Quality Engineer at Red Hat, Tech Lead
Python Standard Library: OS
In today's video, we're going to learn about one of those key modules that everyone needs to know, the os module!
Learn how to interact with your operating system, manage environment variables, execute commands, and even utilize advanced techniques like forking processes and using pipes.
We'll cover everything from the basics to real-world applications, with a fun challenge included! Whether you're a beginner or a seasoned Pythonista, this video has something for you.
As always, please comment below if you have any questions or suggestions for future videos.
Pathlib video: th-cam.com/video/m2hRcRV-kSE/w-d-xo.html
Chapters
========
0:00 - Intro
0:53 - Quick Attributes and Function
2:33 - Environment Variables
6:33 - os.system
7:48 - os.popen
11:09 - basic forking
16:00 - forking with pipes
Follow me on X: x.com/JakeJCallahan
Source: github.com/JacobCallahan/PythonStdlibTour
Learn how to interact with your operating system, manage environment variables, execute commands, and even utilize advanced techniques like forking processes and using pipes.
We'll cover everything from the basics to real-world applications, with a fun challenge included! Whether you're a beginner or a seasoned Pythonista, this video has something for you.
As always, please comment below if you have any questions or suggestions for future videos.
Pathlib video: th-cam.com/video/m2hRcRV-kSE/w-d-xo.html
Chapters
========
0:00 - Intro
0:53 - Quick Attributes and Function
2:33 - Environment Variables
6:33 - os.system
7:48 - os.popen
11:09 - basic forking
16:00 - forking with pipes
Follow me on X: x.com/JakeJCallahan
Source: github.com/JacobCallahan/PythonStdlibTour
มุมมอง: 1 100
วีดีโอ
Understanding Python: String Manipulation
มุมมอง 4142 หลายเดือนก่อน
From URL construction, to user input handling, data processing and much more. String manipulation is one of those core skills that every python programmer must know. So stick with me and we'll add a major skill to your toolset.s. In this video, we cover the most essential built-in functionality Python offers for string manipulation. From concatenation to formatting, splitting to cleaning, we'll...
What You Need To Know About Python 3.13
มุมมอง 12K3 หลายเดือนก่อน
A lot of really exciting changes are coming to Python with this release. While the two biggest aren't production-ready yet, they will be foundational for huge shifts in the Python ecosystem for many years to come! Full release notes: docs.python.org/3.13/whatsnew/3.13.html
PIP vs UV: The Rematch and More!
มุมมอง 2.1K4 หลายเดือนก่อน
I first covered uv about 6 months ago and thought that it had a lot of promise, but just wasn't ready for production yet. Well, I've been using it personally since then and the team has been busy! In fact, they recently dropped a ton of new functionality. Check out their blog post for more information. astral.sh/blog/uv-unified-python-packaging Chapters 0:29 - The Rematch 4:11 - Tool Management...
Understanding Python: Structural Pattern Matching
มุมมอง 4034 หลายเดือนก่อน
Are you tired of nested if-else statements that make your code look like a tangled mess? Structural pattern matching offers a clean, efficient alternative that will save you time and headaches. In this video, we introduce the concept of structural pattern matching, show how to match against sequences with a basic CLI example, demonstrate the challenges when matching class instances, and finally...
Understanding Python: Debugging
มุมมอง 6259 หลายเดือนก่อน
#python #pythontutorial #pythontutorialforbeginners Python errors, strange behaviors, cryptic messages; all too common roadblocks on the way to your perfect code. Well, what if I told you there are ways that you can reach into your code and unravel its runtime mysteries? It's time to take the next step on your way to becoming a Python expert with debugging! As always, please comment below if yo...
PIP vs UV: The Future of Python Package Management?
มุมมอง 6K10 หลายเดือนก่อน
In this video, we take an early look at the UV project by Astral, the team that brought us Ruff! astral.sh/blog/uv github.com/astral-sh/uv/
Understanding Python: Logging Basics
มุมมอง 1.2K10 หลายเดือนก่อน
#python #pythontutorial #pythontutorialforbeginners So you wrote a great program that runs silently until all of a sudden {crash!} it drops an exception. You want to know what led up to this error, but scattering print statements isn't going to cut it. That's when you need to turn to logging, stick with me and you'll learn everything you need to reveal your program's runtime mysteries. As alway...
Python Standard Library: JSON
มุมมอง 43811 หลายเดือนก่อน
This video covers the tools you need to know from the json module. There are a number of subjects covered in this video, so here are some timestamps for each major section. 00:28 - intro 02:58 - dumping 06:09 - loading 08:05 - encoding 11:09 - decoding 13:41 - self serializing 15:18 - json tool cli Follow me on X: x.com/JakeJCallahan Source: github.com/JacobCallahan/PythonStdlibTour/ Intro musi...
Understanding Python: namedtuples
มุมมอง 549ปีที่แล้ว
In this video, we do a deep dive into named tuples. The lesson includes the basics of named tuples, then covers unique methods, some comparisons to alternatives, touches on inheritance and then wraps up with a practical example. As always, please comment below if you have any questions or suggestions for future videos. Chapters 00:28 - Basics 05:00 - Methods 09:00 - Comparison 12:33 - Inheritan...
Python Standard Library: Collections
มุมมอง 1.1Kปีที่แล้ว
This video covers the tools you need to know from the collections module. There are a number of subjects covered in this video, so here are some timestamps for each major section. 00:31 - namedtuple 02:58 - deque 05:58 - Counter 08:58 - defaultdict 12:32 - OrderedDict 14:28 - ChainMap 19:08 - User* base classes Follow me on X: x.com/JakeJCallahan Source: github.com/JacobCallahan/PythonStdlibTou...
Let's Learn Rust: Fundamentals
มุมมอง 205ปีที่แล้ว
We continue our Rust learning journey by visiting the fundamentals. This chapter goes over variables and mutability, data types, functions, comments, and control flow. This chapter really challenged some of my assumptions about Rust, reinforcing some and disproving others. 00:30 - Variables and Mutability 08:57 - Data Types 17:25 - Functions 24:55 - Comments 25:17 - Control Flow Follow along wi...
Python Standard Library: Functools
มุมมอง 2.8Kปีที่แล้ว
This video covers the parts you should know from the functools module. This is a longer video, so here are some timestamps for the main sections. 00:31 - Caching 12:04 - Partials and Reduce 20:18 - Wrappers 25:48 - Dispatches and Ordering Remember that the source code for this series can be found on GitHub at: github.com/JacobCallahan/PythonStdlibTour
Let's Learn Rust: Programming A Guessing Game
มุมมอง 393ปีที่แล้ว
We continue our Rust learning journey with a practical guessing game example. This introduced us to a lot of new syntax and terminology that we'll build upon later. This was a great episode and I really learned a lot! Follow along with us at: rust-book.cs.brown.edu/ch02-00-guessing-game-tutorial.html
From Proof to Publish: Your First PyPI Package
มุมมอง 369ปีที่แล้ว
From Proof to Publish: Your First PyPI Package
Understanding Python: Concurrent Coroutines
มุมมอง 2.3Kปีที่แล้ว
Understanding Python: Concurrent Coroutines
Understanding Python: Abstract Base Classes
มุมมอง 5Kปีที่แล้ว
Understanding Python: Abstract Base Classes
How Satellite QE Does Dynamic Test Infrastructure!
มุมมอง 1733 ปีที่แล้ว
How Satellite QE Does Dynamic Test Infrastructure!
Understanding Python: Virtual Environments
มุมมอง 7923 ปีที่แล้ว
Understanding Python: Virtual Environments
just found your channel and it's GREAT! Covering more advanced concepts with an easy to understand language. Please continue making more of these videos. Thank you
Your channel is the best! You deserve far more subscribers and credit. 🎉
28:11 `raise NotImplementedError`, not `NotImplemented`. The latter is not an exception.
Great catch! Tab completion has failed me again haha. The NotImplemented singleton is indeed an entirely different thing that you can't instantiate. That would definitely be a more confusing exception than the one intended.
awesome explaination
so uv has bugs. this is all what i need to know now
Check out the update video. UV has come a long way since this recording!
Amazing..
wonderful explanation bro 😎 ❤🔥
Great tutorial! Pathlib is such a powerful module and just fun to work with. I remember when it was introduced, how pissed I was that people continued to use the old way with os and shutil and taught this way in tutorials, even to this day, probably because they don't know that pathlib exists. This is the second video on your channel that I checked out and it's sad that you don't have subs in the hundreds of thousand. Great content, great presentation, easy to follow and understand demonstration. There isn't much more to ask from a tutorial series. Regards from Switzerland 👍
Thank you very much! I don't have much time to make videos, so can't maintain the velocity needed for channel growth, but that's ok. As long as people like you find value, that's I need.
Amazing vid, you have an amazing style and I wish you could be my teacher.
Thank you very much. Don't be afraid to let me know if you have any questions I can answer.
can window cmd terminal give code suggestions like ur linux terminal do
Are you referring to when I'm using IPython? Do you have a specific timestamp?
excellent tutorial
great video! I was happy to see it pop up in my notifications! Keep them coming, your channel is one of the best I have found! great job!
Thank you so much for this series related to std library.
Thank you for watching. Let me know if there are any specific modules you would like for me to cover.
@@JakeCallahan Dataclasses module, and comparison with pydantic and when to use which, i hope you consider it as an idea for your future videos
I can certainly move up dataclasses in my list
@@JakeCallahan keep it up, god bless
Just discovered your channel, excellent content!! Corey Schafer level!! , thank you very much
How does one specify the default topping is chese if no topping is specified? I want to know how this can work like kwargs.
Since that is a little more complex behavior, I'd recommend checking the value of parsed_args.toppings. if no toppings were passed, you can set it to ["cheese"].
Most youtubers: 15 2-min video to explain each thing. Jake: 1 30-min video to explain the entire module.
ty for (another) great video! my question, for the final example, on line 25. does this loop need to complete before the tasks will start? because it seems the "all tasks submitted" prints before the tasks start. if we were submitting many more tasks, would it still perform this way?
Great question! So the tasks actually start when submitted to the executor. The reason why is (almost) always prints that the tasks have been submitted first is because it does take a little bit of time for each process to start up. Try this experiment: Add a time.sleep(1) between when the tasks are submitted and the print statement, then see what happens. Play around with the sleep time more as well.
great video! relaxing and informative. You really know your stuff! thank you for teaching us, because I literally started knowing nothing! and you have helped me so much.
Do you primarily use Python's built-in string manipulation tools, or some third-party package?
Ahaha, here we go! My pleasure, Jake! But here is one thing. Your Rust videos motivated me to learn the language and currently I’m switching to Rust and rewriting code in it where possible. So it was kinda „give and take“ :)
When you install using uv pip install [package name] it doesn't get added to the dependency list in pyproject.toml. Any suggestion?
plaese explain more about JIT
tnx🥰
the *uv* team is doing a fantastic job 👏 *uv* is just what bun is for javascript, I'm not a big fan of the "uv" name tbh...
Pedantry: you speak of changes to the language that are not that; they are changes to CPython and its REPL.
I agree that this comment is pedantic ;) Of course, you're correct. I do largely use Python to refer to CPython since it is the most widely used implementation of the Python language. If I do need to speak about other variants, I will call them out by name.
[EDITED] Yes the new version of UV fixes all the issues shown in this video. So thank you Jake for updating on the topic. I have installed and started test/using it. [OLD] UV is a new shiny tool but apart from installing for simple projects, it cannot compete with the old and tested pip right now..may be in the later versions fix all the issues.
Check out my follow-up video linked in the pinned comment. You may be pleasantly surprised at the progress since this video.
Please in next video try using some simpler approach to solve Thank you
Hi, this video is the final one in a 4 part miniseries on concurrency. I highly recommend you use one of the other 3 methods (threading, multiprocessing, async) instead of this. The point of this video was to demonstrate how to use generators in order to implement your own async-like concurrency.
Great video! Stoked to see some more of your Standard Library videos!
Just subscribed, I'm going to start liking all your videos. Hopefully the algorithm notices. This channel needs to take off. Great work!
Welcome, and thanks!
solid tutorial! Subscribing fo shoo
🎯 Key points for quick navigation: 00:00 *🆕 Python 3.13 introduces trends and changes that will shape programming for years.* 00:14 *🔍 Focus on key features: interactive interpreter improvements, free threading, JIT compiler, new CLI for random, argparse deprecations, locals changes.* 00:29 *🖥️ Enhanced interactive interpreter with multi-line editing and better indentation handling.* 00:43 *🧵 Introduction of free threading, a major language change.* 00:56 *🆚 Demonstration of interactive interpreter changes between Python 3.12 and 3.13.* 01:09 *🔄 REPL now retrieves entire class definitions for easier editing.* 01:24 *📐 Automatic indentation handling within functions in Python 3.13.* 01:52 *🖌️ Enhanced prompt and traceback colors for better readability and error reporting.* 03:17 *🛠️ Continuous improvements in tracebacks with clearer error locations.* 03:31 *📚 Invoke help in REPL with just 'help' instead of 'help()'.* 03:44 *❌ Exit and quit commands now work without parentheses in REPL.* 03:59 *🔧 New hotkeys: F1 for help, F2 for input history, F3 for paste mode in interactive interpreter.* 05:20 *⚠️ Free threading is experimental in Python 3.13 and not recommended for production.* 06:57 *⚡ Introduction of an experimental JIT compiler as a tier 2 interpreter.* 08:06 *🎲 New CLI for the random module enhances random operations capabilities.* 09:58 *⛔ Deprecations in argparse allow marking options as deprecated with warnings.* 10:54 *🔄 locals() now returns independent snapshots, improving consistency across implementations.* 11:36 *🧩 Addition of dunder static attributes tracks accessed class attributes during compilation.* 12:33 *🚫 Removal of several modules via PEP 594; check compatibility before upgrading.* 14:10 *🛠️ Changes to C API in Python 3.13; library maintainers need to review release notes.* Made with HARPA AI
OK so version 3.13 is out. Then next Python version will be 3.14... will it be called PIthon? There it is, folks, the worst programming pun of 2024!
Perl has Plain Old Document since 90's (POD). Python will borrow POD in 2024 😄
godlike!
i'm a bit confused about the pytorch pip install demo... the install command you used for "stand-alone pip" vs "uv pip" were exactly the same... or are you saying you did that on the stand-alone pip side also so that it matches that of the uv pip side? can you post the version that works w/ stand-alone pip but doesn't work with uv pip please?
Both use the same install command in this video, correct. Here's the install command from pytorch's website, that didn't work with UV. pip3 install torch torchvision torchaudio --index-url download.pytorch.org/whl/cpu
Another great video! I love how you cover topics that others do not, or if they do, they are very poor at teaching it or explaining it in such a calm, easy manner as you do. Thank YOU for taking the time and putting in the hard work to make these video for us !
just got your vid recommended - ty for the re-review / comparison / update! been using uv for a few days, so far so good (still learning though)
Jackson Anna Lewis Nancy Lewis Susan
Is it going to make Inkscape start faster?
Unfortunately, this won't improve the performance of C++ applications
@@JakeCallahan if its compiled to c++ then why didn’t 3.10 speed it up? 😉
You're blowing my mind!!
Yeah adding those parentheses at the end of help or quit in the REPL were so cumbersome that I almost gave up programming. Thanks for the info!
I can't count how many times I failed to quit the repl on my first attempt! Probably why I switched to IPython
Ctrl-d to send a SIGQUIT signal to quit the REPL, but only on Linux because Windows is poopoo.
I do know thread-safe and thread-unsafe but, is free-threading thread-free?
It isn't thread-free, but more "independent threads" if that makes more sense.
Smooth review!
Thank you for the video. As some constructive feedback, having time annotations really helps someone get to the content about 3.13 they want quickly. To help take your videos to the next level, here are the timestamps you could include so a viewer can get to the content they want to hear about quicker: 0:24 - New Features 0:54 - Interactive Interpreter 5:19 - Free Threading 6:56 - JIT Compiler 8:17 - Random new CLI 10:05 - ARGPARSE Deprecations 10:40 - Changes to How locals() works 11:45 - __static_attributes__ 12:36 - Removed in 3.13 13:10 - Newly Deprecated in 3.13 14:00 - C API Changes 14:59 - Removed from C API 15:40 - Thanks for Watching
Hey there, thanks for taking the time to collect these! I'm actually running a few experiments with this video, including seeing how well TH-cam does with its Automatic Chapters feature. I figure given a more traditional presentation, it has its best shot with this video.
What are you most looking forward to in Python 3.13? Update: it looks like there was a performance regression that has delayed the release to October 7th.
Read somewhere about changes to the GIL in the new version and how it's going to be better. Also, i remember reading that in multiprocessing, sharing data between processes is going to be easier. Tbh, i didn't understand any of it. But again as usual, great video Jake. Your channel is criminally underrated. This was helpful.
So some of the GIL-related changes are applicable to all of Python, and not just free-threaded builds. That's because they've been simplifying and optimizing where and when the lock is acquired and released. I'm notnsure about the multiprocessing changes you're referring to, but sounds promising!
The JIT compiler. Not because it's faster, but because of its future potential. Pypy is great, but always having it lag behind isn't great, so something similar being integrated is a great move, IMO.
How do you keep running a program (like bat, tree) periodically? (Edit: I think I'll move to uv from poetry).
Good question, I just use watch. You can pass it the frequency it should run the command as well.
@@JakeCallahan Thanks! By its man page, it has some useful switches: -d (color changes), -n (change update frequency).
Professional quality tuition and production - as ever!
Why are the namedtuple methods prefixed with underscores when they are intended to be called by the user? Super cool functionality!
That's a very good question! I believe the reason is to avoid name conflicts with possible attributes users want in the named tuple.
UV huh!? The name could be better. Great tool nonetheless
I just wanted to send a little something extra besides my already likes/ shares of your videos. Thank you for these well explained videos, you've helped me so much as I learn things about Python. Your voice and style are calming and your videos are very much underrated in my opinion. Keep going! 💪🏻🎉
Thank you very much! I'm very glad to hear that I was able to help!
I love you man!
This guy pythons! 🐍
Ha, thanks. I appreciate it!