Slimelite BBS

C_Source_In_Python.py.txt

Back to gcc

Embed C source in a Python script DEMO

Size
2.3K (2,384 bytes)
Added
2026-11-20 02:43
Downloads
3
Long Description
Distribution: Public Domain, Emailware. ============================================================================ Architectures: Classic AMIGAs, WinUAE, FS-UAE, OSX 10.14.3, Linux Mint 19. -------------------------------------------------------------------------- MINIMUM Requirements Are:- -------------------------- Stock A1200, 4MB Fastram and HDD. WinUAE 3.4.0, minimum. FS-UAE 2.8.1, minimum. Standard OS 3.0.x install or better. Full Python 1.4.0, minimum, installed, (full install on AMINET): https://aminet.net/package/dev/lang/Python_14 Full ADE UNIX environment install, (full install on AMINET): https://aminet.net/package/dev/gcc/ADE Library file ixnet.library version 48.0 Library file ixemul.library version 48.0 Both files are here if you have NOT got them: https://aminet.net/package/util/libs/ixemul-48.0 (OSX 10.14.3, gcc 4.2.1 and Python 2.7.10, 3.5.2; and also Linux Mint, gcc 7.3.0 and Python 2.7.10.) ---------------------------------------------------------------------------- History:- --------- 01-05-2019. ----------- Version 1.00.00. Probably the one and only upload for this archive. ---------------------------------------------------------------------------- General:- --------- (Apologies for any typos, etc...) Consider this README the instruction manual too. 'C_Source_In_Python.py.txt' This is a Python DEMO designed to run under ADE the *NIX style emulator to create a C script to be compiled under gcc 2.95.3 for the AMIGA A1200. It requires all the dependencies above as it is aimed at AMIGA users of a *NIX style operating system. The C source will build a simple calculator as ADE does not have one by default. It can do floating point, add, subtract, multiply, divide, power and nthroot. As it stands it can be used stand alone in *NIX mode and can cater for floating point arithmetic for KSH88 the default shell for ADE. This python script is designed to demonstrate how to embed a C source[1] into a python script to build your own gcc compiled executables as part of the ADE /bin/ package. The two new files generated are saved inside the current drawer and called mycalc.c, the C source, and calc, the executable file. 1) Download Python_14, unpack and install to the DRIVE:Drawer of your choice. 2) Assign a PYTHON: volume to the DRIVE:Drawer of your Python drawer. For example: Assign PYTHON: WORK:Python-1.4 3) Download ADE, unpack and install ADE the UNIX environment to the DRIVE/Drawer of your choice. 4) As per the instructions install ixnet.library and ixemul.library to the Libs drawer, ONLY, if you have NOT got them. 5) Once everything is ready download the C_Source_In_Python.py.txt and rename it to "C_Source_In_Python.py" without the quotes. 6) Start an AMIGA shell and open it up to at least full width and height. Everything will be inside the AMIGA shell now. 7) Copy the above file from where it was downloaded to your VOLUME:ADE/home drawer. 8) Copy the Python executable to ADE:bin/ drawer as python. 9) Optionally; do the same for MEmacs as this will give a useful editor too in case you need a reasonable one for any editing. 10) Go to YOUR ADE drawer and "Execute ADE-Satrtup" without the quotes. 11) Now enter KSH88 as ksh and after a short while you will then see a prompt, something like: /WORK/ADE> 12) Change this drawer to: cd home 13) Your prompt should now look something like: /WORK/ADE/home> 14) You can now run the file as: python C_Source_In_Python.py<CR> Where <CR> is the ENTER key. 15) The program is SSLLOOWW so be patient. A few notes to be very, VERY aware of:- --------------------------------------- [1] ALL C sources INSIDE any Python code MUST have any _single_ escaped characters in them with _double_escaped charact