X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=print-filename.py;h=e9f217b75b46920f4561b72ce29c0ac6dfcd0cf8;hb=refs%2Fheads%2Fmaster;hp=676aed241a61f27339d011788d0bd5d7491f0ec3;hpb=cdffc4b36468a4d72497c25ec4a3bf1f54fe1b3f;p=xsetbg.git diff --git a/print-filename.py b/print-filename.py index 676aed2..e9f217b 100755 --- a/print-filename.py +++ b/print-filename.py @@ -1,7 +1,7 @@ -#! /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. @@ -53,9 +53,9 @@ def get_args(): 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')