Python tempfile
Question: I am trying to create tempfile but my python versions do not allow me to
proceed and give the following complaints. Do I need to upgrade this version
to use tempfile module. Thanks

    
    
    Python 2.4.3 (#1, Jan  9 2013, 06:47:03) [GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import tempfile
    Traceback (most recent call last):
      File "<stdin>", line 1, in ?
      File "tempfile.py", line 2, in ?
        temp = tempfile.NamedTemporaryFile()
    AttributeError: 'module' object has no attribute 'NamedTemporaryFile'
    


Answer: You are importing a **local** file. You have a file named `tempfile.py` in
your local directory that masks the global module. `import tempfile` imports
that file, not the standard library module.

Use `print tempfile.__file__` to locate that file if you cannot find it.
Rename that file to something else.

The [Python 2.4 `tempfile` module](http://docs.python.org/2.4/lib/module-
tempfile.html) supports `NamedTemporaryFile` without upgrading.

