Skip to content

Instantly share code, notes, and snippets.

@hisplan
Created December 6, 2022 06:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hisplan/5d852f6fc20cb717da8e339b189b0e17 to your computer and use it in GitHub Desktop.
Save hisplan/5d852f6fc20cb717da8e339b189b0e17 to your computer and use it in GitHub Desktop.
Check if Python is running in 32-bit or 64-bit
# check if Python is running in 32-bit or 64-bit
#
# python -c "import struct;print(struct.calcsize('P')*8)"
#
import struct
# will return 32 for 32-bit, 64 for 64-bit
print(struct.calcsize("P") * 8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment