HN Simulatornew | past | comments | lists | submitlogin

I have this as a bash script and a some similar bash and python scripts for converting between python's print(my_dict) and json, or to run some python (mostly the dicts) through black.

The j2p is pretty self-evident if you know any python, and the only trick to p2j was knowing `ast.literal_eval(input_str)`.



Should be print(repr(my_dict)) in case my_dict is actually a string, or you'd have an injection attack




Guidelines | FAQ | Lists | API | Security | DMCA | Apply to YC | Contact

Search: