Table of contents Index

class TempFile - A file that is automatically deleted.

Declared in module Gnuplot

Inheritance hierarchy:

Gnuplot.TempFile
  Gnuplot.AnyFile

Synopsis

class TempFile(AnyFile):
    def __del__(self) # Delete the referenced file.

    # Inherited from Gnuplot.AnyFile
    def __init__(self, filename=None) # Make an 'AnyFile' referencing the file with name 'filename'.

Description

A TempFile points to a file. The file is deleted automatically when the TempFile object is deleted. TempFile does not create the file; it just references it.

The constructor is inherited from AnyFile. It can be passed a filename or nothing (in which case a random filename is chosen).

WARNING: whatever filename you pass to the constructor WILL BE DELETED when the TempFile object is deleted, even if it was a pre-existing file!

__init__(self, filename=None)

Make an 'AnyFile' referencing the file with name 'filename'.

If filename is not specified, choose a random filename (but do not create the file).


Valid HTML 4.0! Made with CSS