top of page
Writer's pictureahmalluqmani

How to install Py and run first code "Hello white world".

Updated: Jan 22, 2022

To install python, we have to check the installation if it is whether installed or not and the version.

%python --version 
%python3 --version 

Go to this link :


Download the last version compatible with omputer operatin system .

On Our case is Mac.

  • Install the software as default press continue .




Run code through IDEL :


IDEL and python launcher come with the download folder of python installation .


  • Double Click on( IDEL)

Coming up a window of IDLE SHELL , which is ( IDLE ) interpreter. It is used to show the output straight it is for command to check but if we want to use for writhing a program.

IDLE SHELL gives the same environment of console. it is usually using to test the function of program pattern in relation of input and output.



On the other hand, .Py provide the environment program to type code and display the input and the output into IDLE SHELL in order to ease the communicate with users.


  • Click on File > New file or Command + N.

  • Open a ( text-editor ) file and change the extension into (.py).


print('what is your name?')
Name =input()
Print('good morning','Name')

>>> press ( F5 ) or run the module .


It will be transferring into the interrupter, output window IDEL Shell.



Run code through terminal :

% cd [ PATH DIRECTORY]

Click on (ctrl+I) and copy paste the path directory for folder where the python file location.

The terminal states the python directory then type the file-name.py .

% hellotheworld.py

It will make the terminal do the function of IDEL SHELL.




Third way using the vs code , jupiter notebook and pycharm



VSC HELPS TO EXCUTE THE python program and you can do coding formatting include the code space and the terminal .






Comments


bottom of page