Created
November 18, 2021 13:26
-
-
Save nitinbhojwani/69bffe864e9e064aca25a5857476629c to your computer and use it in GitHub Desktop.
Create temporary file in Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tempfile | |
def _create_temp_file_with_content(file_content): | |
fp = tempfile.NamedTemporaryFile(delete=False) | |
fp.write(file_content) | |
return fp.name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment