Did I find the right examples for you? yes no

All Samples(506)  |  Call(480)  |  Derive(0)  |  Import(26)
Queries the given executable (defaults to the Python interpreter
binary) for various architecture information.

Returns a tuple (bits,linkage) which contains information about
the bit architecture and the linkage format used for the
executable. Both values are returned as strings.

Values that cannot be determined are returned as given by the
parameter presets. If bits is given as '', the sizeof(pointer)
(or sizeof(long) on Python version < 1.5.2) is used as(more...)

        def architecture(executable=sys.executable,bits='',linkage=''):

    """ Queries the given executable (defaults to the Python interpreter
        binary) for various architecture information.

        Returns a tuple (bits,linkage) which contains information about
        the bit architecture and the linkage format used for the
        executable. Both values are returned as strings.

        Values that cannot be determined are returned as given by the
        parameter presets. If bits is given as '', the sizeof(pointer)
        (or sizeof(long) on Python version < 1.5.2) is used as
        indicator for the supported pointer size.

        The function relies on the system's "file" command to do the
        actual work. This is available on most if not all Unix
        platforms. On some non-Unix platforms where the "file" command
        does not exist and the executable is set to the Python interpreter
        binary defaults from _default_architecture are used.

    """
    # Use the sizeof(pointer) as default number of bits if nothing
    # else is given as default.
    if not bits:
        import struct
        try:
            size = struct.calcsize('P')
        except struct.error:
            # Older installations can only query longs
            size = struct.calcsize('l')
        bits = str(size*8) + 'bit'

    # Get data from the 'file' system command
    if executable:
        output = _syscmd_file(executable, '')
    else:
        output = ''

    if not output and \
       executable == sys.executable:
        # "file" command did not return anything; we'll try to provide
        # some sensible defaults then...
        if sys.platform in _default_architecture:
            b, l = _default_architecture[sys.platform]
            if b:
                bits = b
            if l:
                linkage = l
        return bits, linkage

    # Split the output into a list of strings omitting the filename
    fileout = _architecture_split(output)[1:]

    if 'executable' not in fileout:
        # Format not supported
        return bits,linkage

    # Bits
    if '32-bit' in fileout:
        bits = '32bit'
    elif 'N32' in fileout:
        # On Irix only
        bits = 'n32bit'
    elif '64-bit' in fileout:
        bits = '64bit'

    # Linkage
    if 'ELF' in fileout:
        linkage = 'ELF'
    elif 'PE' in fileout:
        # E.g. Windows uses this format
        if 'Windows' in fileout:
            linkage = 'WindowsPE'
        else:
            linkage = 'PE'
    elif 'COFF' in fileout:
        linkage = 'COFF'
    elif 'MS-DOS' in fileout:
        linkage = 'MSDOS'
    else:
        # XXX the A.OUT format also falls under this class...
        pass

    return bits,linkage
        


src/b/e/BeginningPythonExercises-HEAD/other/system_admin/PULSA/pythonForSystemAdmin/src/example_8_1.py   BeginningPythonExercises(Download)
 
profile = [
platform.architecture(),
platform.dist(),
platform.libc_ver(),

src/f/o/foobnix-HEAD/foobnix/util/LOG.py   foobnix(Download)
 
    logging.debug('==Executable Architecture==')
    logging.debug('interpreter:' + str(platform.architecture()))
    logging.debug('/bin/ls    :' + str(platform.architecture('/bin/ls')))
    logging.debug('*******************************************************')

src/p/y/pyradar-0.2/pyradar/utils/system_info.py   pyradar(Download)
 
    executable_architecture_info = {
        'interpreter': platform.architecture(),
        '/bin/ls': platform.architecture('/bin/ls')
    }

src/h/o/hortonworks-sandbox-HEAD/desktop/core/ext-py/Spawning-0.9.6/src/spawning/util/system.py   hortonworks-sandbox(Download)
    def __init__(self):
        dict.__init__(self, {
            'architecture': platform.architecture(),
            'max_int': sys.maxint,
            'max_size': sys.maxsize,

src/f/l/flyscript-portal-HEAD/rvbd-portal/rvbd_portal/apps/console/scripts/about.py   flyscript-portal(Download)
print 'Compiler     :', platform.python_compiler()
print 'Build        :', platform.python_build()
print 'Architecture :', platform.architecture()
 
print ""

src/f/l/flyscript-portal-HEAD/rvbd-portal/rvbd_portal/apps/report/utils.py   flyscript-portal(Download)
    output.append('Compiler     : %s' % str(platform.python_compiler()))
    output.append('Build        : %s' % str(platform.python_build()))
    output.append('Architecture : %s' % str(platform.architecture()))
 
    output.append("")

src/s/p/Spawning-0.9.7/spawning/util/system.py   Spawning(Download)
    def __init__(self):
        dict.__init__(self, {
            'architecture': platform.architecture(),
            'max_int': sys.maxint,
            'max_size': sys.maxsize,

src/s/p/Spawning-HEAD/spawning/util/system.py   Spawning(Download)
    def __init__(self):
        dict.__init__(self, {
            'architecture': platform.architecture(),
            'max_int': sys.maxint,
            'max_size': sys.maxsize,

src/f/l/flyscript-0.6.0/utilities/flyscript_about.py   flyscript(Download)
print 'Compiler     :', platform.python_compiler()
print 'Build        :', platform.python_build()
print 'Architecture :', platform.architecture()
 
print ""

src/p/a/pave-0.69/pave/inspector.py   pave(Download)
def query():
    details = dict(encoding=gdl()[1],
        arch=p.architecture(),machine=p.machine(),node=p.node(),
        proc=p.processor(),py_vers=p.python_version(),
        py_vert=p.python_version_tuple(),os_release=p.release(),

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next