def call_c():
 library = expanduser('~/.image.so')
 sauce = join(dirname(__file__), 'image.c')
 if ((not exists(library)) or (getmtime(sauce) > getmtime(library))):
  build = ('cc -fPIC -shared -o %s %s' % (library, sauce))
  os.system((build + ' >/dev/null 2>&1'))
 image_c = ctypes.cdll.LoadLibrary(library)
 image_c.init()
 return image_c.rgb_to_ansi

def call_c ( ) : library = expanduser ( '~/.image.so' ) sauce = join ( dirname ( __file__ ) , 'image.c' ) if ( ( not exists ( library ) ) or ( getmtime ( sauce ) > getmtime ( library ) ) ) : build = ( 'cc -fPIC -shared -o %s %s' % ( library , sauce ) ) os . system ( ( build + ' >/dev/null 2>&1' ) ) image_c = ctypes . cdll . LoadLibrary ( library ) image_c . init ( ) return image_c . rgb_to_ansi
call the c program for converting rgb to ansi colors .