cfile-0.2.0
توضیحات
A C code generator written in Python 3
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | cfile-0.2.0 |
| نام | cfile |
| نسخه کتابخانه | 0.2.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Conny Gustafsson |
| ایمیل نویسنده | congus8@gmail.com |
| آدرس صفحه اصلی | https://github.com/cogu/cfile |
| آدرس اینترنتی | https://pypi.org/project/cfile/ |
| مجوز | - |
# cfile
A C code generator written in Python 3.
## Usage
```python
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))
```
```C
#include <stdio.h>
int main(int argc, char **argv)
{
printf("Hello World!\n");
return 0;
}
```
## Requires
Python 3
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6 | Python |
نحوه نصب
نصب پکیج whl cfile-0.2.0:
pip install cfile-0.2.0.whl
نصب پکیج tar.gz cfile-0.2.0:
pip install cfile-0.2.0.tar.gz