-#! /usr/bin/env python
-"""Print background filename
+#! /usr/bin/env python3
+"""print(background filename)
-Print the filename of the current or previous background image.
+print(the filename of the current or previous background image.)
This file is a part of XSetBg.
output_encoding = default_encoding
return index, output_encoding
-index, output_encoding = get_args()
+index, output_encoding = get_args()
filename = xsetbg_db.select('last_shown IS NOT NULL',
orderBy='-last_shown')[index].full_name
-print filename.encode(output_encoding)
+sys.stdout.buffer.write(filename.encode(output_encoding) + b'\n')