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.5.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.5-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jupygcc-0.0.5.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.5.tar.gz
Algorithm Hash digest
SHA256 71504aec5862ac9ac0c9511dfa5f36b84c225cfbda3080da9233e9a4342625af
MD5 1930913ab61728f2e80cb0ef3bd9c2e2
BLAKE2b-256 d6ee39233de63ec5260681d12c62681ab3443c6a52c1bb8374bb929d2cc553b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for jupygcc-0.0.5.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.5-py3-none-any.whl.

File metadata

  • Download URL: jupygcc-0.0.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0af582ed1d0a28787726341e41ffcab89af565f2d18ad8d0d0e633ae6d0a0129
MD5 5760e78173908c063854306ea85ffd79
BLAKE2b-256 3d507552735a259e1d70cc862cebe1e1ea34f68e8dac14b9437f0fbed918bc40

See more details on using hashes here.

Provenance

The following attestation bundles were made for jupygcc-0.0.5-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