Use tempfile module to create a temporary file

Temporary directory in Windows is not a /tmp, use tempfile module
Merge pull request #2 from shiena/patch/tempfile

Use tempfile module to create a temporary file