Sunday, April 19, 2020
python function arguments
Python function arguments
You might have seen *, ** (asterisks ) in functions definition -arguments in python. Don't confuse them with C pointers.They are actually totally different.
Below examples take you through defaults ,keyed and VarArgs parameter passing in python.
Reference: https://python.swaroopch.com/functions.html
python function arguments Example 1
python function arguments Example 2
Python function arguments Example 3
Python arguments with tuple and dictionary
Friday, April 17, 2020
6 ways to run python
Python language interpreter
Python interpreter can be used many ways from command line.
Beginners guide: https://wiki.python.org/moin/BeginnersGuide
Developers guide: https://devguide.python.org/
- Call a Python interactive shell (REPL):
python
- Execute script in a given Python file:
- Execute script as part of an interactive shell:
- Execute a Python expression:
- Run library module as a script (terminates option list):
- Interactively debug a Python script:
8 beginners commands to start with Docker
Installation guides:
windows - https://docs.docker.com/docker-for-windows/
linux - https://docs.docker.com/engine/install/
mac - https://docs.docker.com/docker-for-mac/install/
docker basic
Installation guides:
windows - https://docs.docker.com/docker-for-windows/
linux - https://docs.docker.com/engine/install/
mac - https://docs.docker.com/docker-for-mac/install/
-
List currently running docker containers:
docker ps
-
List all docker containers (running and stopped):
docker ps -a
-
Start a container from an image, with a custom name:
docker run --name container_name image
-
Start or stop an existing container:
docker start|stop container_name
-
Pull an image from a docker registry:
docker pull image
-
Open a shell inside of an already running container:
docker exec -it container_name sh
-
Remove a stopped container:
docker rm container_name
-
Fetch and follow the logs of a container:
docker logs -f container_name