This is a development version (9.18.0.dev) and may be unstable.Go to latest (9.17.0)
{ } Raw JSON

bundles / IPython 9.18.0.dev / IPython / core / interactiveshell / InteractiveShell / mktempfile

function

IPython.core.interactiveshell:InteractiveShell.mktempfile

source: /IPython/core/interactiveshell.py:4013

Signature

def mktempfile(self, data = None, prefix = ipython_edit_)

Summary

Make a new tempfile and return its filename.

Extended Summary

This makes a call to tempfile.mkstemp (created in a tempfile.mkdtemp), but it registers the created filename internally so ipython cleans it up at exit time.

Optional inputs:

  • data(None): if data is given, it gets written out to the temp file immediately, and the file is closed again.

Aliases

  • IPython.InteractiveShell.mktempfile