Use uuid.uuid4() to create new file

python

Solution

You need to convert the `uuid` to a `str`:

>>> import uuid
>>> str(uuid.uuid4()) + ".txt"
'13eb9327-f40e-4ef1-8020-1c36af1b4b70.txt'

Problem

How do you concatenate the uuid.uuid4() value with a literal when creating a file? The below isn't correct but should illustrate what I'm attempting to do... ``` fo = open(uuid.uuid4() + ".txt", "wb") ```

Original source