Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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')


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: