2 ms·
https://docs.python.org/3/library/tempfile.html https://docs.python.org/3/library/tempfile.html >>> tempfile.mkstemp(suffix='.pdf') (4, '/tmp/tmp0g7l3uq7.p
by tinix 6y ago
https://docs.python.org/3/library/tempfile.html https://docs.python.org/3/library/tempfile.html
>>> tempfile.mkstemp(suffix='.pdf')
(4, '/tmp/tmp0g7l3uq7.pdf')
one could take it a step further...
>>> tempfile.mkstemp(suffix='.pdf', prefix=uuid.uuid4().hex)
(5, '/tmp/7b7881400a2348bfae63d37b970d4489pqhz_1g2.pdf')