- cross-posted to:
- [email protected]
- cross-posted to:
- [email protected]
python -m http.server
came in handy so many times!@wasabi @learnbyexample one of my favorite super lazy ways to share a file
I use
json.tool
a lot to format JSON directly in vim. Simply highlight the text you want to format and run:!python3 -m json.tool
. There are probably plugins to do this too, but doing it this way is probably the simplest, unless vim has a built-in for it.Could probably do the same with
:! jq .
It’s a bit shorter.Yeah, I knew someone was going to say that. Usually it’s more likely that Python is installed than jq - especially on servers. But yes, that would definitely work too.
Pro tip: you can ignore filenames with ripgrep using
-g "!test/"
. That should speed things up a bit.python -m http.server
has been a very useful tool to me, to test if a server is accessible.Nice work!
Easier than grepping, you can just look at the standard library docs: https://docs.python.org/3/library/
How is that easier? It doesn’t look like it provides a list of which modules have a
__name__ == "__main__"
block.