Skip to main content

No project description provided

Project description

jupygcc

PyPI - Version PyPI - Python Version


Installation

pip install jupygcc

Usage

Load the extension.

```{python}
#| echo: false
#| output: false
%load_ext jupygcc
```

Provides both %gcc line magic that takes a c filename as argument and %%gcc cell magic that handle c code in the cell.

Line magic.

```{python}
%gcc ex1/main.c
```

Cell magic.

#include <stdio.h>
int somme(int n) {
  if (n <= 0)
    return 0;
  else
    return (n + somme(n - 1));
}
int main() {
  printf("u(%d= %d", 6, somme(6));
  return 0;
}

Configuration

Currently, the kernel can't be configured and will always use:

  • -std=c99 -Wall for C code

  • Wrap the code in a main function if it doesn't already have one with:

    #include <stdbool.h>
    #include <stddef.h>
    #include <stdint.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <math.h>
    

Cell metadata

Currently, the only cell metadata handled is stdin.:

//| stdin: 10
int n;
printf("How many lines? ");
scanf("%d", &n);
printf("\n%d lines\n");

Development

  • Test: hatch run test
  • Coverage: htach run coverage

License

jupygcc is distributed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jupygcc-0.0.6.tar.gz (34.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jupygcc-0.0.6-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file jupygcc-0.0.6.tar.gz.

File metadata

  • Download URL: jupygcc-0.0.6.tar.gz
  • Upload date:
  • Size: 34.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for jupygcc-0.0.6.tar.gz
Algorithm Hash digest
SHA256 daf416ac99a04d84e6f4892f06990f4626f8f85369da60088ef4cf009db17851
MD5 0f69b4f9c669533ff288cda1d927b3d1
BLAKE2b-256 b7cd851a6ecc42261000eb1788076d88741cf66b21a0f87d90bfb3ed5dd452e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for jupygcc-0.0.6.tar.gz:

Publisher: python-publish.yml on benabel/jupygcc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jupygcc-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: jupygcc-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for jupygcc-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 2c2ff58229f132f4357b9b3fca1015533641d6717a5f8a055b04d03d5f1c6e29
MD5 dd4b57a463fe564892f60d79eef8a438
BLAKE2b-256 e0da85277bd7e87576b2873826a57bc6acae6ee20c2ad53133fc42590bc65e64

See more details on using hashes here.

Provenance

The following attestation bundles were made for jupygcc-0.0.6-py3-none-any.whl:

Publisher: python-publish.yml on benabel/jupygcc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page