I've made both such a HORRIBLE and AWESOME prototype in python, it's call "py2sh", you give it whatever python file and it will allow you to call every function of this file directly from the cli will allowing you to parse arguments.

This is like a python-shell bridge :p

(and I have way worst ideas for that)

Oh and it's only 32 lines of code x)

@bram That sounds really neat! Especially the fact that it's so short.

Count me curious!

@HerraBRE here you go :)

All the heavy job is done by argh, it's a bit like "how you shouldn't have used argh" kind of project :p

@khimaros yup, that's basically a generalisation of python-fire combine with argh automatically generated on any python file :)

@bram this, like unit testing, could be a net positive if it encourages people to write functional code on immutable data
Did you think about a new getops implementation for Yunohost when you did this ?

@josue no, I haven't spend a lot of time on this getopt thing but I had the feeling that this could be useful for YunoHost yes (while not really wanting it, it's dirty)

Sign in to participate in the conversation

This is a mastodon instance for social justice activists, LGBTQIA+ people, and activists in general See the Goals and technical details, and Rules and privacy policy pages for more information