Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialTatiana Vasilevskaya
Python Web Development Techdegree Graduate 28,600 PointsTemporary file example from video does work on Mac
If I'm not mistaken, Kenneth meant this code as the example of temporary file handling, which works fine on Mac.
import tempfile
with tempfile.TemporaryFile() as tmpfile:
tmpfile.write(b"hello\n")
tmpfile.seek(0)
tmpfile.read()
1 Answer
Craig Dennis
Treehouse TeacherThat's right Tatiana, I spotted that typo too. Kenneth Love accidentally called write
on tempfile
and not tmpfile
. That's the problem with these temporary throw away names!
Kenneth Love
Treehouse Guest TeacherKenneth Love
Treehouse Guest TeacherHow rude
Craig Dennis
Treehouse TeacherCraig Dennis
Treehouse Teacher