Call arbirary Python code on the last n words!
Project description
plover_retro_stringop
Call arbirary code on the last n words! This is inheritly unsafe and horrible, yay!
Complaints go to [[redacted]]@[[redacted]].com.
Usage
{:retro_stringop:N:EXPR}
, where N
is the number of words (backwards) to work on and EXPR
is the expression that constitutes the new text.
This has text
as the entire string and words
as an array of the individual words (already stripped, use raw_words
for words including the spaces).
{:retro_stringop_sh:N:EXPR}
does the same stuff, but calls /bin/sh
, and provides the text as TEXT
env var.
Examples
{:retro_stringop:1:"(" + text + ")"}
: surround last word in parenthesis{:retro_stringop:2:"(" + text + ")"}
: surround last two words in parenthesis{:retro_stringop_sh:1:echo "$TEXT" | tee some-file.txt}
: log last word to some-file.txt (tee is used here to so that the word doesn't get deleted){:retro_stringop:1:text[::-1]}
: reverse the last word{:retro_stringop_sh:1:cat "$TEXT"}
: read the last word as a filename, and read that file, replacing the filename with the content{:retro_stringop:3:"".join([w.lower().capitalize() for w in words])}
: PascalCase the last 3 words
Project details
Release history Release notifications | RSS feed
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
Close
Hashes for plover_retro_stringop-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b8a227af0256ca161b2a449beee52e942f0a8ffa1340c0bec9f681cedfa73a2 |
|
MD5 | 3d2dd069ea19d7625e59187bc00f64ef |
|
BLAKE2b-256 | 5ba741383175494fa0d57157dad4e651fa79fd4cb466bad712d78d259221bab0 |
Close
Hashes for plover_retro_stringop-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b29b1a7a636d3f8bf2dc6a4e82c235e99be10798b17a5ffbc70c19a418bbc58 |
|
MD5 | 666b2eb98cdc7ef1b9332fc919a7579b |
|
BLAKE2b-256 | 4ee9972caf0ff764e6ead29ea903129c49460bbc14ed6f82d5beaf5d9cf25e4c |