/Pyrunc

Python package to write C code directly into python

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Pyrunc

License: GPL v3 Codacy Badge Travis (.org) Codecov Code Style


Introduction

A python package to directly embeed C/C++ code in python script/program/code.

Project Description

  • Wrapper around ctypes Python package.
  • Tests in python 3.7 on Windows OS(by developer).
  • main.py contains simple metric for comparison.

Installation

Windows

git clone https://github.com/Kartikei-12/Pyrunc
cd Pyrunc-master
python -m venv venv
./venv/Scripts/activate
pip install -r requirements.txt

Linux based OS

git clone https://github.com/Kartikei-12/Pyrunc
cd Pyrunc-master
python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt

Usage

For simple example,

Run main.py as python main.py on windows with virtual environment(./venv/Scripts/activate).

Run main.py as python3 main.py on Ubuntu/Linux with virtual environment(source /venv/Scripts/activate).

System Requirements

  • Python 3
  • Pip usually pre-installed with python, check with pip3 --version.
  • GNU-GCC is required to compile C code(working on packaging in project itself).

Limitation

Currently only runs C code not C++ code as ctypes python module only supports C and not C++.

Contributer(s)

@Kartikei Mittal

Unittest Results

Start Time: 2019-06-16 09:59:21

Duration: 1.14 s

Summary: Total: 2, Pass: 2

__main__.DummyTests Status
test_dummy Pass
Total: 1, Pass: 1 -- Duration: 0 ms
__main__.PyruncTests Status
test_simple_mathematical_formula Pass
Total: 1, Pass: 1 -- Duration: 1.14 s