2023-01-07 10:24:29 +03:00
|
|
|
# template-python
|
|
|
|
|
2023-01-08 16:16:31 +03:00
|
|
|
Template repository for projects on python
|
|
|
|
|
|
|
|
* [`script.sh`](https://git.hmp.today/pavel.muhortov/template-python#script-py)
|
|
|
|
|
|
|
|
____
|
|
|
|
## `script.py`
|
|
|
|
**Description:**
|
|
|
|
> returning current username if privileged rights are exist
|
|
|
|
> or
|
|
|
|
> returning error, if privileged rights are not exist
|
|
|
|
|
|
|
|
|
|
|
|
**Dependencies:**
|
|
|
|
> - Python 3 (tested version 3.9.5)
|
|
|
|
|
|
|
|
|
|
|
|
| PARAMETERS | DESCRIPTION | DEFAULT|
|
|
|
|
|-------------|-------------|--------|
|
|
|
|
|**[-s,--show]**|"" - execution with pauses.<br/>"qn" - execution without pauses.||
|
|
|
|
|**[-c,--conf]**|path to configuration file|./script.conf|
|
|
|
|
|
|
|
|
|
|
|
|
Example usage in terminal with Python on Linux:
|
|
|
|
```shell
|
2023-01-26 19:58:13 +03:00
|
|
|
python3 ./script.py
|
2023-01-08 16:16:31 +03:00
|
|
|
```
|
|
|
|
Example usage in terminal with make the script executable on Linux:
|
|
|
|
```shell
|
|
|
|
chmod u+x ./script.py
|
|
|
|
script.py -s qn -c ./script.conf
|
|
|
|
```
|
|
|
|
Example usage in terminal with Python on Windows:
|
|
|
|
```shell
|
2023-01-26 19:58:13 +03:00
|
|
|
python .\script.py
|
2023-01-08 16:16:31 +03:00
|
|
|
```
|