MCPcopy Create free account
hub / github.com/devosoft/avida / queryPython

Function queryPython

avida-core/support/utils/AvidaUtils/PythonTool.py:36–41  ·  view source on GitHub ↗
(python_command, sysconfig_variable)

Source from the content-addressed store, hash-verified

34trailing_whitespace_re = re.compile(r'^\s*(.*)\s*$')
35
36def queryPython(python_command, sysconfig_variable):
37 query_command = """ -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('%s')," """
38 line = os.popen(python_command + query_command % sysconfig_variable).readline()
39 line = trailing_whitespace_re.sub(r'\1', line)
40 if not none_re.match(line): return line
41 else: return None
42
43def checkPython(python_command):
44 check_command = """ -c "print 'hello'," """

Callers 1

generateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected