Full Changelog: https://github.com/tusharsadhwani/zxpy/compare/1.6.2...1.6.3
Published by tusharsadhwani about 2 years ago
Full Changelog: https://github.com/tusharsadhwani/zxpy/compare/1.6.1...1.6.2
Published by tusharsadhwani over 2 years ago
zxpy
by itself wouldn't work before this.Published by tusharsadhwani over 2 years ago
Added interactive mode option: zxpy -i myfile.py
.
Full Changelog: https://github.com/tusharsadhwani/zxpy/compare/1.5.2...1.6.0
Published by tusharsadhwani about 3 years ago
Full Changelog: https://github.com/tusharsadhwani/zxpy/compare/1.5.1...1.5.2
Published by tusharsadhwani about 3 years ago
read1()
instead of select polling, to simplify some logicecho -n
, as that is linux-specificPublished by tusharsadhwani about 3 years ago
Adds Python3.10 support
Published by tusharsadhwani about 3 years ago
select
module to do non-blocking reads from the shell process, instead of reading 1 byte at a time. Leads to significantly faster output for large streams, without any blocking.process.communicate()
to read stdout and stderr without causing deadlock due to buffer overflow.Published by tusharsadhwani about 3 years ago
~'...'
raises an error if the process exits with a non-zero return code[a, b, c] = ~'...'
Published by tusharsadhwani about 3 years ago
Now you can pass whole commands as variables inside f-strings, without quoting.
Take this piece of code:
>>> cmd = 'uname -a'
>>> ~f'{cmd}'
/bin/sh: 1: uname -a: not found
This is because uname -a
was quoted into 'uname -a'
to avoid shell injection.
To avoid this, support for :raw
format_spec as added:
>>> cmd = 'uname -a'
>>> ~f'{cmd:raw}'
Linux pop-os 5.11.0 [...] x86_64 GNU/Linux
Note that this shouldn't be used with external data, or this will expose you to shell injection.
Published by tusharsadhwani about 3 years ago
Previously, only a few select ~'...'
statements were being printed out, rather than any bash-string without any assignments to its left. This patch version fixes printing logic.
Published by tusharsadhwani over 3 years ago
Fixes the previous broken build, refer #19
Published by tusharsadhwani over 3 years ago
Refer #18
Published by tusharsadhwani over 3 years ago
__name__
will now be '__main__'
, just like how it is when running any other file directlyzxpy
command is now supportedPublished by tusharsadhwani over 3 years ago
Anything passed as an f-string into a bash string will be automatically quoted with shlex.quote
.
i.e., ~f'{xyz}'
is the same as ~f'{shlex.quote(xyz)}
Published by tusharsadhwani over 3 years ago
stdout, stderr, return_code = ~'...'
. Fixes #6Published by tusharsadhwani over 3 years ago
Published by tusharsadhwani over 3 years ago
expr
transformations. Cleaned up a bunch of AST code.print(~'echo test')
Published by tusharsadhwani over 3 years ago
zx.start()
to zx.install()
for clarityPublished by tusharsadhwani over 3 years ago
(~f'...').splitlines()