Skip to main content
Home

Built and signed on GitHub Actions

The python-cli module provides a simple way to execute python scripts or files.

This package works with Node.js, Deno, Bun
This package works with Node.js
This package works with Deno
This package works with Bun
JSR Score
100%
Published
a year ago (0.1.1)

The python-cli module provides a simple way to execute python scripts or files.

The module relies upon the @gnome/exec module and has the same basic usage as the Command and ShellCommand class.

Basic Usage

import { pythonScript, python } from "@gnome/python-cli";

const cmd = await pythonScript("print('Hello, World!')");
console.log(await cmd.text());
console.log(cmd.code);

console.log(await pythonScript("print('Hello, World!')").text());

console.log(await pythonScript("test.py").text());
console.log(await python(["test.py"]).text())
console.log(await python(["-V"]).text());

// runs python script and writes directly to console
await pythonScript("print('I am alive')").run();
Built and signed on
GitHub Actions

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@gnome/python-cli

Import symbol

import * as python_cli from "@gnome/python-cli";
or

Import directly with a jsr specifier

import * as python_cli from "jsr:@gnome/python-cli";

Add Package

pnpm i jsr:@gnome/python-cli
or (using pnpm 10.8 or older)
pnpm dlx jsr add @gnome/python-cli

Import symbol

import * as python_cli from "@gnome/python-cli";

Add Package

yarn add jsr:@gnome/python-cli
or (using Yarn 4.8 or older)
yarn dlx jsr add @gnome/python-cli

Import symbol

import * as python_cli from "@gnome/python-cli";

Add Package

vlt install jsr:@gnome/python-cli

Import symbol

import * as python_cli from "@gnome/python-cli";

Add Package

npx jsr add @gnome/python-cli

Import symbol

import * as python_cli from "@gnome/python-cli";

Add Package

bunx jsr add @gnome/python-cli

Import symbol

import * as python_cli from "@gnome/python-cli";