How to save and run Python program?

Step for Saving Python Program:


Youtube Tutorial: How to Save and run Python program (Please Subscribe this Channel for more video tutorial)


  1. Open Notepad using run command or Right click on desktop and select New text document.

  2. Save it with extension (.py). You will see the file like this.

  3. Sometime it happens that you will not see this file type due to hidden file extension of .txt, you have to unhide this option. Step to unhide the file extension:
  • Go to File explorer
  • Click on the File option on left top side.
  • Select Change Folder and Search options.
  • Click on View tab. Uncheck the Hide extensions for known file type.

  • Click on Apply to Save.
  • Now again open new text document and see there you will the .txt extension.


  • You can see difference between this.
4. Now save the .py extension file and remove the .txt extension from text document you will see the python file logo.

To run Python program using file

  1. Type Run on search bar and type cmd to open Command Prompt or Type cmd on Search bar.
  2. I have saved my file in desktop to I will go to cmd and with cd command I will enter to desktop. Type this cd Desktop and press Enter 
  3. Edit file with notepad(File which is previous made with .py extension and Write a program in file and save it.
            print("Hello!World")

    4. Now write "python filename.py"(whatever your file name) and Press Enter

You can the output in cmd 




Comments

Popular posts from this blog

List, Sort, Reverse, Adding, removing & modifying elements of List