Tech C**P
14 subscribers
161 photos
9 videos
59 files
304 links
مدرس و برنامه نویس پایتون و لینوکس @alirezastack
Download Telegram
Tech C**P
How to get method name in python? The inspect module provides several useful functions to help get information about live objects such as modules, classes, methods, functions, tracebacks, frame objects, and code objects. For example, it can help you examine…
You can also use inspect.stack()[2][3] instead of getting current frame and then getting its outer frames:
inspect.stack returns a list of frame records for the caller’s stack. The first entry in the returned list represents the caller; the last entry represents the outermost call on the stack.

#python #inspect #stack
Some useful docker commands:

docker stack ls
List stacks or apps

docker stack deploy -c <composefile> <appname>
Run the specified Compose file

docker service ls
List running services associated with an app

docker service ps <service>
List tasks associated with an app

docker inspect <task or container>
Inspect task or container

docker container ls -q
List container IDs

docker stack rm <appname>
Tear down an application

docker swarm leave --force
Take down a single node swarm from the manager

#docker #cheatsheet #inspect #stack #swarm #service