1 unstable release

0.1.0 Jun 25, 2024

#1994 in Development tools

MIT license

25KB
505 lines

pymainprocess

Python Extension Module for the best System Interaction, based on Rust.

opinion

  1. Faster then Python OS and Python Subprocess Module.
  2. Great Interaction, fast Import.
  3. Runs Greate on Windows and Unix.

install

pip

python3 -m pip install pymainprocess

pip from git

python3 -m pip install git+https://github.com/pyrootcpp/pymainprocess

pip from archive

python3 -m pip install https://github.com/pyrootcpp/pymainprocess/archive/master.zip

for pyrootcpp APT Repo user

sudo apt-get install python3-pymainprocess

Import

Best Practice

import pymainprocess as procs

Using

The Most Actions are similiar to OS and Subprocess but faster and better.

Maybe you want Safe an Output.

import pymainprocess as proc

command = "dpkg --print-architecture"
stdout = proc.call(command, stdout=True, safe_output=True)
arch = stdout.strip()

This Module have an Implemented function for run commands as sudo, for example

from pymainprocess import sudo

command = "apt-get update"
user = "root"
sudo(command=command, user=user)

sudo is not available on Windows Computer.

Dependencies

~6–15MB
~223K SLoC