Hacker News new | ask | show | jobs
by d4rti 724 days ago
Works for sure:

  $ file ./bin/python
  ./bin/python: DOS/MBR boot sector; partition 1 : ID=0x7f, active, start-CHS 
  (0x0,0,1), end-CHS (0x3ff,255,63), startsector 0, 4294967295 sectors

  $ ./bin/python
  Python 3.11.4 (heads/pypack1:6eea485, Jan 24 2024, 10:14:24) [GCC 11.2.0] on 
  linux
  Type "help", "copyright", "credits" or "license" for more information.
  >>> import platform
  >>> platform.processor()
  'arm'
2 comments

I forget how I did this, but:

    $ file hello.com
    hello.com: αcτµαlly pδrταblε εxεcµταblε
Out of curiosity, why are you running python packed with cosmopolitan ?
Presumably to demonstrate that it works on Mac ARM platforms, in response to the question about that.
If was satisfied with my own presumption I wouldn't have asked ;)
That Python app is a popular demo for Cosmopolitan. It's what I would have chosen for that demo, too! It's handy because it outputs a little bit of information about the current architecture on the first line when you start the shell.

There's some interesting background on it in this issue: https://github.com/jart/cosmopolitan/issues/141