Setting up Python Interpreter and running Python Code on Docker Container

1 : We need to install docker

2 : Start docker services And to check status :

# systemctl start docker

command to check status of docker services

#systemctl status docker

3 : To launch any OS we need image for that

I have used centos:7

#ocker pull centos:7

4 : To launch docker container :

I have launched centos:7 by assigning name as python_int

#docker run -it — name python_int centos:7

5.To use python on top of docker first thing we have to do is to install the python software using following command.

“yum install python3”

6.Now let’s write some code on Python Interpreter..

For getting into python interpreter we have to use command #python3

then we can now write our python code over interpreter and we can run our code as well.

Task completed successfully !😃🎇



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store