⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 numeric.py

📁 利用C
💻 PY
字号:
#!/usr/bin/env pythonimport Numericimport osfrom os.path import sep, joinfrom commonPkgConfigUtils import *def pkgTests(forceCompiler=None, sconsEnv=None, **kwargs):    return True# Generate a pkg-config file for numeric, put it in the given # directory, if no directory is given, a suitable location is found # using the functionality from commonPkgConfigUtils.# Nothing in kwargs is used, it is included to ensure a consitent # interface for the generatePkgConf function.def generatePkgConf(directory=suitablePkgConfDir(), **kwargs):    """Use Numeric.__file__ to find out where Python is installed, and set    variables."""    print "Generating pkg-config file for '%s' in %s" % ("numeric", directory)    fullpath = Numeric.__file__    #pref, lib, py = fullpath.split(os.path.sep)[1:4]    splitfullpath = fullpath.split(sep)    # it is safe to assume that 'site-packages' is somewhere in there...    sitepackind = splitfullpath.index('site-packages')    # the python-version is the one just infront of site-packages    py = splitfullpath[sitepackind-1]    # lib is before that    lib = splitfullpath[sitepackind-2]    # prefix is from the beginning up to lib    pref = splitfullpath[1:sitepackind-2]    prefix      = sep + sep.join(pref)    libdir      = sep + lib    includedir  = sep + "include"    pydir       = sep + py + sep    """Set some relevant pkg-config file values. Are all these required?"""    name = "Numeric"    desc = "Numerical Python"    version = Numeric.__version__    reqs = ""    libs = ""    cflags = "-I${includedir}%s" % pydir     """Construct the content of the pkg-configfile"""    pkg = """prefix=%sexec_prefix=${prefix}libdir=${exec_prefix}%sincludedir=${prefix}%sName: %sDescription: %sVersion: %sRequires: %sLibs: %sCflags: %s""" % (prefix, libdir, includedir, name , desc, version, reqs, libs, cflags)    """Write the content to file, using correct version number"""    file = open("%s/numeric-%s.pc" % (directory,str(version)[:2]), "w")    file.write(pkg)    file.close()if __name__ == "__main__":    generatePkgConf(directory=".")

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -