[Python] How to stop tempfile.NamedTemporaryFile from adding random characters to the end of...

Discussão em 'Python' iniciado por Stack, Dezembro 7, 2024.

  1. Stack

    Stack Membro Participativo

    I'm trying to make a temporary file that will last for the duration of my program. I want the user to be able to easily access this file in their chosen text editor.

    Because of this, I'm wondering how I could get rid of the random characters that are appended to the end of the prefix in the temp file, NamedTemporaryFile? Because it makes harder for the user to type it.

    Normally it is like this:

    aDataSetn6jw9ehy.py


    I would like it to work like this:

    aDataSet.py

    Continue reading...

Compartilhe esta Página