Note: here command or snippets are for python3, most the command might work in python2 and you might have to change few things to make it work in python2
A very basic one but important part here to know is most of the command will have the same syntax to get the version details
python3 --versionAgain a basic once, but this tells us that we can run a small python snippet just via the cli, without writing/creating a python file. a lot of other programming languages (basically their executables) also gives the same functionality
python -c "print('Hello')"A quick way to get MD5 hash of a string
python3 -c "import hashlib; print(hashlib.md5(b'Ashish').hexdigest())"same goes for sha512
python3 -c "import hashlib; print(hashlib.sha512(b'Ashish').hexdigest())"If you have a requirement of to transfer files (over http), this small cli based approach of python can help you quickly expose all the files (hierarchy with subfolder and files) of your CWD over http port (you can customize the port as per your requirement)
python3 -m http.server 80