Mike Driscoll

@driscollis
395 Followers
13 Following
1.2K Posts

I write, blog, podcast and more about everything #Python

Writing about Python at https://blog.pythonlibrary.org/ and https://pythonpapers.com/

Teaching at https://teachmepython.com/

Podcasting at https://pythonshow.com/

Author of multiple books, including Python 101

Bloghttps://blog.pythonlibrary.org/
Teach Me Pythonhttps://teachmepython.com/
The Python Showhttps://pythonshow.com/
The Python Papershttps://pythonpapers.com/

#Python Pop Quiz πŸβ“

What is the output of the following code?

A) {[4,5,6]}
B) 4, 5, 6
C) [4, 5, 6]
D) [4,5,6]

#Python Pop Quiz πŸβ“

What is the output of the following code?

A) Syntax Error
B) ...
C) Ellipsis
D) None of the above

#Python Pop Quiz πŸβ“

What is the length that is returned?

A) 0
B) 1
C) 2
D) None of the above

#Python Pop Quiz πŸβ“

What is the output of the following code?

A) AttributeError
B) 10
C) 14
D) 7

#Python Pop Quiz πŸβ“

What is the output of the following code?

A) a ['b', 'c']
B) ['a', 'b', 'c']
C) ['b', 'c']
D) None of the above

#Python 101 - How to read a TOML file using a `pathlib.Path` object

#Python Pro Tip 🐍

If you use the uv package manager, don't forget to clean up every so often. You may end free up gigabytes of data on your hard drive!

Python 101: Reading TOML with Python

The TOML (Tom’s Obvious Minimal Language) format came out in 2013, so it’s been around for more than a decade.

The Python Papers

The latest edition of the Python Papers Newsletter is out now!

Learn how to read a TOML document with #Python using the standard library! 🐍πŸ”₯

If you like my #Python content, you might want to check out my Python newsletter.

It's called The Python Papers. You will get at least one email per week with a tutorial, news, a video or perhaps all three!

You can subscribe here:

http://pythonpapers.com

Γ—
#Python 101 - How to read a TOML file using a `pathlib.Path` object
@driscollis you can just call `read_bytes()` on the Path instance, no need for the context manager dance