import os import sysconfig import sys def distutils_dir_name(dname): """Returns the name of a distutils build directory""" f = "{dirname}.{platform}-{version[0]}.{version[1]}" return f.format(dirname=dname, platform=sysconfig.get_platform(), version=sys.version_info) print(os.path.join('build', distutils_dir_name('lib')), end = '')