# -*- coding:utf-8 -*-
import leveldb, sys

dbname = 'artist_db1'

def select(name):
    print 'Your input artist name is %s' % (name)
    db = leveldb.LevelDB('db_name1')
    try:
        result = db.Get(name)
        print 'This artist\'s activity area %s' % (result)
    except KeyError:
        print 'Not Found.'

def main():
    argvs = sys.argv
    argc = len(argvs)
    if argc != 2:
        print 'Argument Error!'
        sys.exit(1)
    select(argvs[1])

if __name__ == '__main__':
    main()
