Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
/shPublic

Python process launching

License

NotificationsYou must be signed in to change notification settings

amoffat/sh

Repository files navigation

Logo

If you are migrating from 1.* to 2.*, please see MIGRATION.md


VersionDownloads StatusPython VersionsCoverage Status

sh is a full-fledged subprocess replacement for Python 3.8 - 3.12, and PyPythat allows you to callany program as if it were a function:

fromshimportifconfigprint(ifconfig("eth0"))

sh isnot a collection of system commands implemented in Python.

sh relies on various Unix system calls and only works on Unix-like operatingsystems - Linux, macOS, BSDs etc. Specifically, Windows is not supported.

Complete documentation here

Installation

$> pip install sh

Support

Developers

Testing

Tests are run in a docker container against all supported Python versions. To run, make the following target:

$> make test

To run a single test:

$> make test='FunctionalTests.test_background' test_one

Docs

To build the docs, make sure you've runpoetry install to install the dev dependencies, then:

$> cd docs$> make html

This will generate the docs indocs/build/html. You can open theindex.html file in your browser to view the docs.

Coverage

First run all of the tests:

$> SH_TESTS_RUNNING=1 coverage run --source=sh -m pytest

This will aggregate a.coverage. You may then visualize the report with:

$> coverage report

Or generate visual html files with:

$> coverage html

Which will create./htmlcov/index.html that you may open in a web browser.


[8]ページ先頭

©2009-2025 Movatter.jp