pyufunc.create_tempfile#

pyufunc.create_tempfile(base_dir='./', ext='txt')#

Create a temporary file with the specified size.

Parameters:
  • base_dir (str, optional) – The directory to create the file in. Defaults to “./”.

  • ext (str, optional) – The extension of the file. Defaults to “txt”.

Returns:

The path to the created file.

Return type:

str

Example

>>> from pyufunc import create_tempfile
>>> create_tempfile(base_dir="./", ext="txt", size_in_kb=1)
'./file.txt'