Terminal extension for python
Project description
# TerminalPyth
Library that allows you to call terminal commands in python whithout discarding previous commands (unlike os.system() command does).
Install:
$ pip install terminalpyth
Usage:
import terminalpy
Create a terminalpy object. Pass True or False as argument if you want (or not) to have back the output.
trm = terminalpy.Terminal(output=True)
Only one straight-forward method: type. Pass inside it the command you want to be executed.
output = trm.type(‘pwd’)
# in this case, returns path to the current directory, # which in this case is stored in “output”
It works with pretty much every terminal command.
To use “sudo”, if you are not in a terminal session itself, you must add the “-S” option, to read the password from your IDE (e.g. Pycharm).
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
Built Distribution
Hashes for terminalpyth-1.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fb36a8bbc16b7e44a25b5da97099e8b3af1b7f4492c6013332c4bf6fa34cb0e |
|
MD5 | c71cfa7312a7497006354dd0e804ec39 |
|
BLAKE2b-256 | 4cad2439a7d9710604207ab2e0a71aabd1d70bf741bd4e8ca16e09ec38f2507d |