GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - dsoderholm/cfile: A python C code generator

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

20 Commits
20 Commits

Folders and files

NameName
Last commit message
Last commit date
.vscode
.vscode
 
 
cfile
cfile
 
 
doc
doc
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
MANIFEST.in
MANIFEST.in
 
 
README.rst
README.rst
 
 
setup.py
setup.py
 
 
usage.py
usage.py
 
 

Repository files navigation

cfile

A python C code generator.

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;
}

Prerequisites

Python 3

About

A python C code generator

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.