aboutsummaryrefslogtreecommitdiffstats
path: root/lyrics/hd.py
blob: 173342c9809b0ca82428c2c3aa1f0721e3072f03 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/python
#
# Load lyrics from the user's home directory
#
# Author: Max Kellermann <max@duempel.org>
#

from sys import argv, exit, stdout
from os import environ
from os.path import expanduser

path = expanduser("~/.lyrics/%s - %s.txt" % (argv[1], argv[2]))
try:
    f = file(path)
except IOError:
    exit(2)

while True:
    x = f.read(4096)
    if not x:
        break
    stdout.write(x)