Working with temporary files can be a must in certain situations, but are you working with them correctly? If not, you're opening yourself up to security vulnerabilities. In this video, we'll be using the `tempfile` module to create temporary files easily and securely!
00:00 - Intro [1]
01:01 - Creating a named temporary file [2]
04:13 - Creating a temporary directory [3]
04:57 - Creating a temp file within a temp directory
06:05 - Other interfaces in the tempfile module
07:25 - Using this with a Pytest fixture [4-5]
[1] https://cwe.mitre.org/data/definition...
[2] https://docs.python.org/3/library/tem...
[3] https://docs.python.org/3/library/tem...
[4] https://alembic.sqlalchemy.org/en/latest
[5] https://docs.pytest.org/en/stable
—
If you want to see more of me, join my Discord server!
/ discord
I get a lot of people asking, so here's my setup!
• Visual Studio Code: • My Visual Studio Code setup! (2024)
• Terminal: • Make your terminal look AMAZING
• Desk/recording gear: https://kit.co/Carberra
• PC build: https://uk.pcpartpicker.com/list/TmzGYN
Affiliations (I may earn a commission):
• Codecrafters -- 40% off any plan: https://app.codecrafters.io/join?via=...
• Keeper Password Manager -- 30% off your first year: https://keeper.io/r/EX4FB1C
—
If you have any questions, don't hesitate to ask in the comments! I'll try and answer as soon as I can, providing someone else hasn't already done so.
#python #coding #howto