How to run python program?

 Run Program in Python IDLE

IDE (PyCharm)
To run Python script on a IDE (Integrated Development Environment) like PyCharm, you will have to do the following:

  • Create a new project.
  • Give a name to that project as ‘GfG’ and click on Create.
  • Select the root directory with the project name we specified in the last step. Right click on it, go in New and click on ‘Python file’ option. Then give the name of the file as ‘hello’ (you can specify any name as per your project requirement). This will create a ‘hello.py’ file in the project root directory.
    Note: You don’t have to specify the extension as it will take it automatically.

  • Now write the below Python script to print the message:
    print('Hello World !')
  • To run this python script, Right click and select ‘Run File in Python Console’ option. This will open a console box at the bottom and show the out put there. We can also run using the Green Play Button at the top right corner of the IDE.

Output:

Comments

Popular posts from this blog

Coding standards?

programming language?

Computer programming languages?