File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 22
33### * PYTHON EDitor: cli to edit lines via Python expressions*
44
5- > For Pythonistas tired of forgetting the syntax of ` sed ` /` awk ` /` grep ` /` tr `
5+ > For Pythonistas tired of forgetting the syntax/options of ` sed ` /` awk ` /` grep ` /` tr `
66
7- ### ⬇️ install
7+ ## install
88``` bash
99pip install pythoned
1010```
1111(it sets up ` pythoned ` in your PATH)
1212
13- ### ✒️ edit
14- One must simply provide a Python ` str ` expression that manipulates the line in the ` _ ` variable (an ` str ` ) :
13+ ## edit
14+ One must simply provide a Python ` str ` expression, manipulating the line stored in the variable ` _: str` :
1515
1616``` bash
1717# get last char of each line
2424r
2525```
2626
27- ### 🛑 filter
27+ ## filter
2828If the expression is a ` bool ` instead of an ` str ` , then the lines will be filtered according to it:
2929``` bash
3030# keep only lines whose length equals 3
31- echo -e ' f00\nbar\nf00bar' | pythoned ' len(_) == 3 '
31+ echo -e ' f00\nbar\nf00bar' | pythoned ' "00" in _ '
3232```
3333output:
3434```
3535f00
36- bar
36+ f00bar
3737```
3838
39- ### 📦 modules auto-import
39+ ## modules
4040
4141Modules are auto-imported, example with ` re ` :
4242``` bash
@@ -48,4 +48,4 @@ output:
4848fXX
4949bar
5050fXXbar
51- ```
51+ ```
You can’t perform that action at this time.
0 commit comments