Skip to main content

This is a library based on the ex command.

Project description

Yet Another EX command library

This is a library based on the ex command. So, it works the same way :)

Usage

from yaex import *

result = yaex(
    append("Hello"),
    append("World"),
)
print(result)
# >Hello
# >World
# >

result = yaex(
    append("first line"),
    append("second line"),
    append("third line"),
    go_to(2),
    delete(),
)
print(result)
# >first line
# >third line
# >

result = yaex(
    append("first line"),
    append("second line"),
    append("third line"),
    move(-1),
    delete(),
)
print(result)
# >first line
# >third line
# >

result = yaex(
    append("first line"),
    append("second line"),
    append("third line"),
    search("second"),
    delete(),
)
print(result)
# >first line
# >third line
# >

result = yaex(
    append("# yaex\n\nThis is a library based on the ex command.\n"),
    go_to_first_line(),
    delete(),
    insert("# Yet Another EX command library"),
)
print(result)
# ># Yet Another EX command library
# >
# >This is a library based on the ex command.
# >

result = yaex(
    append("first line\nsecond line\nthird line\nfourth line\nfifth line\nsixth line\n"),
    delete().from_range(search("second"), search("fifth")),
)
print(result)
# >first line
# >sixth line
# >

result = yaex(
    append("first line\nsecond line\nthird line\nfourth line\nfifth line\nsixth line\n"),
    substitute("line", "LINE").from_range(go_to_first_line(), go_to_last_line()),
)
print(result)
# >first LINE
# >second LINE
# >third LINE
# >fourth LINE
# >fifth LINE
# >sixth LINE
# >

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

yaex-1.0.0.tar.gz (4.8 kB view hashes)

Uploaded Source

Built Distribution

yaex-1.0.0-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page