Skip to main content

cfile

A C code generator written in Python 3.

Usage

import cfile as C
hello = C.cfile('hello.c')
hello.code.append(C.sysinclude('stdio.h'))
hello.code.append(C.blank())
hello.code.append(C.function('main', 'int',).add_param(C.variable('argc', 'int')).add_param(C.variable('argv', 'char', pointer=2)))
body = C.block(innerIndent=3)
body.append(C.statement(C.fcall('printf').add_arg(r'"Hello World!\n"')))
body.append(C.statement('return 0'))
hello.code.append(body)
print(str(hello))
   #include <stdio.h>

   int main(int argc, char **argv)
   {
      printf("Hello World!\n");
      return 0;
   }   

Requires

Python 3

Metadata

Release files for cfile 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cfile 0.2.1
File Size Uploaded
cfile-0.2.1.tar.gz 5.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cfile 0.2.1
File Interpreter ABI Platform
cfile-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.4 kB

Release files / cfile-0.2.1.tar.gz

Download URL cfile-0.2.1.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7b702fcdb2bdab1b153ad3d78519ccff42c86b3470f4b31c85ac02cad9d2de81
BLAKE2b-256 checksum
How to use checksums
0e8c1b718050978ccea2e338cc36381dfb21c7c5536d06e150ef39251c945a7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / cfile-0.2.1-py3-none-any.whl

Download URL cfile-0.2.1-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a187a6c81c9677ff9c6bcea898b02b29b241e0f3fb7ecc62cfe62377d632dbae
BLAKE2b-256 checksum
How to use checksums
acd14f5291f99a30b5eab24acb648a9be8e0a3e2390083f7c00471bcf86c4dff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

0.4.0

2 release files

This release

0.2.1 This release

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page