What are PY files? How to Open PY Files on a Windows 10 PC?

Running a Python code for the first time? Maybe you downloaded a Python (PY script ) but have no idea how to open it. PY files are python script files, and today, we will learn how to open PY files on a Windows 10 PC.

A numerous number of extensions available at this time can lead to having confusion to use a certain method the can help you to access your desiring file. But researching a little can help you that how you can access any extension with how many steps you actually need to access any file.

In today’s article, I will tell you about the .py file. What is .py file, and how you can access this type of file in your Computer or PC? So, here are enough ways to access your .py file on your own.

What are PY files How to Open PY Files on a Windows 10 PC

What are PY files? How to Open PY Files on a Windows 10 PC?

Py file or .py extension means python compiled file. Developers or coders are huge demands who develop applications and codes in Python, and it also tends to increase in .py file <filename.py>, and if you downloaded any file which has an extension as .py means, it is asking for Python. Before accessing and running the .py file, you need to download Python on your computer so that your computer can have .py file understandable.

How to open py files in Windows 10

There are many possible ways to access a py file, but here I shortlisted and tried to make precise steps for access PY file in an essential way.

Advertisements

Download Python and running .py file

If you are finding a good way to access and run a py file, then it’s quite helpful to Download Python by itself and accessing the file by this method.

Follow the step to access the file from Python

Step 1: Download CPython interpreter. Press Python 3.6.0 or more updated version of python.

Step 2: Install the file from the Downloads.

Step 3: Press the Windows button. 

Step 4: Search CMD in the search box.

Step 5: Right-click on CMD (black box icon) and Run as Administrator.

Step 6: Click Yes on the prompt.

Advertisement

Step 7: Open your <filename>.py file by typing cd and entering the Drive name.

Example your file is in D drive so simply type

  cd D:/

Step 8: Enter this command C:\Python27\python.exe  <filename>.py

In this way, you can run your .py file in your Windows.

Open PY  file and edit in Notepad++

Notepad++ is one of the most popular text editor tool used by developers and coders, and it can also help you to open your .py file

Step 1: Download Notepad++ on your computer. 

Step 2: Install Notepad++ from downloads

Step 3: Open your Notepad++ application

Step 4:  Click on the file

Step 5: Click on Open

Step 6:  Browse your file you want to open.

This section will help you more in editing the script you have in .py file. You can also edit the script in Notepad too, but Notepad++ helps more to understand the code more efficiently.

So yes, you can also edit the script in Notepad, but Notepad++ gives you some advantages by third party plug-in.

Conclusion

There are different methods to access and run .py file in the different OS while then I covered this article regarding windows, whereas for the beginners, it can be a little difficult, but attempting steps will help you to understand the working of python file. 

Python helps to build applications more for websites, and nowadays, the most demanded language for Machine Learning and AI, so no surprise that you want to work more on Python.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.