Generate a run of integers or characters. Similar to jot and seq.
Project description
A simple command line tool to create sequences of numbers.
drang-run is comparable to jot or seq, but with a more intuitive interface. It was inspired (and named after) a post by Dr. Drang.
Installation
Just install like any other package:
pip3 install drang-run
This will install the run command.
run --version
Usage
Basic usage includes up to three arguments:
run [START] STOP [STEP]
START and STEP are optional and have 1 as default.
$>run 4
1
2
3
4
$>run 5 8
5
6
7
8
$>run 0 10 3
0
3
6
9
Reverse the sequence with -r:
$>run 4 -r
4
3
2
1
Format the output with --format. The option accepts any kind of Python format string.
$>run 998 1002 --format "{: >4}."
998.
999.
1000.
1001.
1002.
You can use decimals for START, STOP and STEP:
$>run 1.1 1.5 .15
1.1
1.25
1.4
Using letters will generate character sequences:
$>run d g
d
e
f
g
By default, the sequence is separated by a newline character \n, but you can change this with -s:
$>run d g -s "\t"
d e f g
Run additional sequences with --also START STOP STEP:
$>run 1 2 -- also 3 4 1
1-3
1-4
2-3
2-4
Of course, this can be used with characters and be formatted:
$>run 1 2 -- also b c 1 --format "{0:02}. {1}_{1}"
01. a_a
01. b_b
02. a_a
02. b_b
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
File details
Details for the file drang-run-0.3.6.tar.gz
.
File metadata
- Download URL: drang-run-0.3.6.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.11 CPython/3.9.7 Darwin/20.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11ccddad65e1b6fa13817a9e9c998cfe408357768929993d45bf2c3ac9517931 |
|
MD5 | 566ba7a33e6b571bc7297891972b51a3 |
|
BLAKE2b-256 | 916788847300440434e5ea7122efdb19cec0d4c0ae57b1e5c6fc5d4a727bdeed |
File details
Details for the file drang_run-0.3.6-py3-none-any.whl
.
File metadata
- Download URL: drang_run-0.3.6-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.11 CPython/3.9.7 Darwin/20.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f1d3502f3d31837163d029cb2e210844b0a7040d0e1c779f6342c2bf49c2469 |
|
MD5 | 3dc8349f2e2cafe97fd4342dccf55bb7 |
|
BLAKE2b-256 | ef0cb390a6daba8f59af9de44290596bceceb636ad193946c431c3c7e4963929 |