News for hackers. Stuff that matters.
Re:Cosmopolitan Libc v2.0 by jeremyjh on Saturday August 20, 2022 @08:16AM (#32531459)
Very cool! Is there a way to make a single executable file with the python build and our own python script files?
Re:Cosmopolitan Libc v2.0 by jart on Saturday August 20, 2022 @09:16AM (#32531853)
Indeed! Try this:

    # git clone https://github.com/cosmopolitan
    # make -j8 o//third_party/python/python.com
    wget https://justine.lol/ftrace/python.com
    mkdir .python
    printf 'print("hello world")\n' >.python/hello.py
    printf -- '-m\nhello\n' >.args
    zip -r python.com .python .args
    chmod +x ./python.com
    ./python.com
This is a great way for white-labeling the APE Python interpreter as your own program. You just put your source code inside the executable using the zip command. Then you add a .args file that specifies the default argv[] array if the user didn't specify any arguments.