Remove tempory files at program exit, combination of tempfile and atexit should be as simple as possible.
Project description
tempfileatexit
Python library for removing temporary files and directories when program finishes.
Usage
import tempfileatexit
import tempfile
(fs, my_tempfile) = tempfile.mkstemp()
my_tempdir = tempfile.mkdtemp()
tempfileatexit.register(my_tempfile)
tempfileatexit.register(my_tempdir)
print(tempfileatexit.list(verbose=True))
After you run the code and the program exxists, the my_tempfile
and
my_tempdir
will be gone.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for tempfileatexit-0.0.2.linux-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c5294afb38c573f4b4ff36aa0b1d3e07e6933bbd572c01dca1da5840414b124 |
|
MD5 | e089728142d78ee559b7a045570af18d |
|
BLAKE2b-256 | a4615693e6307ceab736e52564aa9b4736dfc6833012c52006b03ee2df94f32d |
Close
Hashes for tempfileatexit-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d31669eb5498b26f3d883444372da2d15654fd96c06f737888ab982820feb802 |
|
MD5 | 05054202f4c995219653ec01ab395a25 |
|
BLAKE2b-256 | d3b54d9eaac71bcfe224bc103bd523c97601963aeb542e0d86e10c55e7bf1cf6 |