Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #5027

Finding the bitness of an arbitrary executable with Python

Date 2011-05-09 15:52 -0500
From Andrew Berg <bahamutzero8825@gmail.com>
Subject Finding the bitness of an arbitrary executable with Python
Newsgroups comp.lang.python
Message-ID <mailman.1358.1304974381.9059.python-list@python.org> (permalink)

Show all headers | View raw


I need to find whether a given file is 32-bit or 64-bit (and raise an
exception if the file doesn't exist or isn't an executable file). I
thought platform.architecture() would do this, but it returns ('64bit',
'') no matter what value I assign to the executable parameter (looks
like it uses the given executable to find info on the underlying system
rather than info on the specific file, reverting to sys.executable if
there are any errors). A quick look on Google doesn't give me anything
useful. Something cross-platform would be nice, but it really only needs
to work on Windows (on win32 binaries).

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Finding the bitness of an arbitrary executable with Python Andrew Berg <bahamutzero8825@gmail.com> - 2011-05-09 15:52 -0500
  Re: Finding the bitness of an arbitrary executable with Python Richard Thomas <chardster@gmail.com> - 2011-05-09 14:02 -0700
  Re: Finding the bitness of an arbitrary executable with Python Irmen de Jong <irmen.NOSPAM@xs4all.nl> - 2011-05-09 23:10 +0200
    Re: Finding the bitness of an arbitrary executable with Python Andrew Berg <bahamutzero8825@gmail.com> - 2011-05-09 16:44 -0500

csiph-web