use tuples when doing string formatting
clean this up
use tuples when doing string formatting
use os.path.join() api to construct absolute file paths
clean this up a little bit, use os.path.join api and ensure file handles are closed