这篇文章将向您展示如何在Windows 10中打开(Windows 10)Python PY 文件(PY files)。PY 是用Python编程语言编写的脚本文件。在这篇文章中,我们介绍了一些在Windows 10中(Windows 10)打开 Python 脚本(open Python scripts)的免费工具。您可以查看 PY 文件的内容并对其进行编辑。因此,这些也可以用作Python 文件编辑器软件(Python file editor software)。
这些工具还提供运行 PY 文件的功能——(run PY files –)但必须在您的 PC 上安装Python 解释器(Python Interpreter)才能使用该功能。或者,您也可以使用命令提示符(Command Prompt)和Python 解释器(Python Interpreter)来运行Python脚本文件。
在 Windows 10 上打开 PY 文件
我们添加了 5 个免费的Python文件查看器软件来打开Python文件:
- PyCharm
- PyScripter
- 托尼
- 记事本++
- 原子。
1] PyCharm
PyCharm 是一个很好的Python IDE(集成开发环境(Integrated Development Environment))程序,用于打开、编辑和运行Python脚本。它带有用于打开 PY 文件的导航窗格。您还可以在单个界面的不同选项卡上打开不同的Python文件。(Python)使其更有用的功能是您可以在单独的部分中查看问题列表并检查它们的(view the list of problems)快速修复(quick fixes)。它的调试器工具也很有帮助。
下载该软件的免费开源社区版(Download the free open-source community edition)。在安装过程中,它还提供了将其添加到右键单击上下文菜单并将Python文件与其关联的选项。
首次打开后,您可以使用UI Themes插件选择主题(浅色或深色)。您以后可以随时使用Settings(Settings)更改主题。之后,您可以跳过其余插件,创建新项目或打开现有项目。或者简单地使用Ctrl+Shift+N热键或访问文件(File)菜单或导航菜单打开Python文件。(Python)
现在开始编辑,调试脚本,并使用它的运行(Run)菜单或给定的按钮运行你的Python脚本。(Python)
2] PyScripter
PyScripter是另一个开源Python IDE软件,可帮助您轻松查看和编辑 PY 脚本。它具有一些很好的功能,如显示/隐藏特殊字符、语法高亮(syntax highlighting)、切换断点、代码折叠(code folding)、语法检查(syntax checking)、调试器提示、通过提供文件名和SSH服务器打开远程文件、显示/隐藏行号、使用不同的主题、等等
获取该软件的设置(Grab the setup)并安装它。在安装此软件时,您还可以启用将其与Windows右键菜单集成的选项。
打开其主界面,然后您可以创建一个新项目。或者,您可以使用导航窗格或文件(File)菜单添加Python脚本。选项卡式界面功能也可以打开多个脚本。您可以在主部分查看和编辑脚本,并在底部查看断点、变量、输出和其他项目。(variables)除此之外,还有不同的菜单,如运行菜单(Run menu)来执行语法检查、运行脚本等,以及您可以使用的按钮。
3] 托尼
Thonny是在(Thonny)Windows 10上创建 PY 文件、打开Python文件和编辑 PY 文件的不错选择。这个开源工具具有简单的界面,旨在供初学者使用。它带有预添加的 Python 3.7(pre-added Python 3.7) ,因此您无需单独安装Python 解释器(Python Interpreter)即可运行Python脚本。
除此之外,它还有许多其他有用的功能,使其比基本的Python查看器工具更好。您可以show/hide outlines、变量、程序树等,使用View菜单,选择Interpreter (默认或其他可用),运行脚本,并使用(Interpreter)Run菜单调试当前脚本,代码完成(code completion)建议等。自动突出显示语法错误(automatically highlight syntax errors)(如未闭合的引号或括号)也在那里。
使用此链接(this link)获取此工具。打开界面后,使用“文件(File)”菜单创建新文件或添加现有的 PY 文件。您还可以在单独的选项卡上打开多个Python脚本。之后,您只需要探索和使用不同菜单中的选项并充分利用它。
另请阅读:(Read Also:)如何在 Windows 10 上使用 PIP 安装 NumPy(install NumPy using PIP on Windows 10)。
4]记事本++
Notepad++是一个非常通用的源代码编辑器和文本编辑器。它支持多种格式来打开普通文本文件、编程文件(如 C++、C# 等)、Java文件、JSON、LaTeX、Windows PowerShell文件等。这也是打开和编辑 PY 的好选择文件。您还可以检查鼠标光标可用的总行数、选定行和列数。
该软件提供PY 文件的语法高亮显示(syntax highlighting)、标签式界面以在不同的选项卡上打开多个Python文件、(Python)启动和停止宏录制(start and stop macro recording)等。您还可以使用“运行”(Run)菜单运行Python脚本并提供安装在您的Python解释器的路径个人电脑。
Grab Notepad++ from here。Notepad++的便携版或安装版后,启动它,然后使用File菜单添加Python文件。之后,它的内容是可见的,您可以根据需要进行编辑。之后,您可以使用相同的菜单保存文件或Python文件的副本。(Python)
5]原子
Atom是由(Atom)GitHub开发的开源文本和代码编辑器软件。它支持Markdown和其他代码文件,也支持 PY 文件。该界面是用户友好的,您可以在其中打开多个 PY 文件并对其进行编辑。它带有文本选择、文本自动完成(text auto-complete)、行号、启用/禁用树视图、代码折叠(code folding)、增加/减小文本大小、更改文本大小写(change text case)和其他选项。
它的下载链接在这里(here)。启动后,您可以打开 PY 文件或项目。添加文件后,您可以开始编辑,并使用不同菜单中的可用选项。您还可以通过使用“文件”菜单访问“设置”来更改其默认主题。(Settings)
设置页面还可以帮助您安装(install packages)Python文件的包。例如,您可以搜索并安装python-debugger包。之后,您可以使用Packages菜单并通过添加输入参数和调试器命令来使用Python文件调试器。(Python)
您可以找到并安装更多的包,例如格式化Python代码、在终端中运行Python文件、将文档字符串添加到(Python)Python等,以使其对 PY 脚本文件更有用。
这些是一些很好的工具,可用于在Windows 10(Windows 10) PC中打开Python PY文件。虽然Python IDE程序更好用,但简单的文本和代码编辑器工具也可以很好地在Windows PC中打开 PY 文件。(Windows PC)希望(Hope)这些Python文件查看器会有所帮助。
提示(TIP):这里有一些最好的网站来学习或提高您的 HTML 编码知识(learn or improve your HTML coding knowledge)。
How to open and view Python PY files on Windows 10
This post will show you how to open Python PY files in Windows 10. PY is a script file written in Python programming language. In this post, we have covered some free tools to open Python scripts in Windows 10. You can view the content of a PY file and also edit it. Thus, these can also be used as Python file editor software.
These tools also provide the feature to run PY files – but Python Interpreter has to be installed on your PC to use that feature. Alternatively, you can also use Command Prompt and Python Interpreter to run a Python script file.
Open PY Files on Windows 10
We have added 5 free Python file viewer software to open Python files:
- PyCharm
- PyScripter
- Thonny
- Notepad++
- Atom.
1] PyCharm
PyCharm is a good Python IDE (Integrated Development Environment) program to open, edit, and run Python scripts. It comes with a navigation pane to open a PY file. You can also open different Python files on separate tabs in a single interface. The features that make it more useful are you can view the list of problems in a separate section and check quick fixes for them. Its debugger tool is also helpful.
Download the free open-source community edition of this software. During the installation process, it also provides the options to add it to the right-click context menu and associate Python files with it.
After opening it for the first time, you can choose a theme (light or dark) using a UI Themes plugin. You can always change the theme later using Settings. After that, you can skip the remaining plugins, create a new project, or open an existing project. Or simply open a Python file using Ctrl+Shift+N hotkey or accessing the File menu or navigation menu.
Now start the editing, debug the script, and run your Python script using its Run menu or given buttons.
2] PyScripter
PyScripter is another open-source Python IDE software to help you easily view and edit a PY script. It comes with some good features like show/hide special characters, syntax highlighting, toggle breakpoints, code folding, syntax checking, debugger hints, open a remote file by providing file name and SSH server, show/hide line numbers, use different themes, etc.
Grab the setup of this software and install it. While installing this software, you can also enable the option to integrate it with the Windows right-click menu.
Open its main interface and then you can create a new project. Or else, you can use the navigation pane or File menu to add a Python script. The tabbed interface feature is also there to open multiple scripts. You can view and edit the script in the main section and view breakpoints, variables, output, and other items in the bottom section. Apart from that, there are different menus like the Run menu to perform syntax check, run the script, etc., and buttons that you can use.
3] Thonny
Thonny is a nice option to create a PY file, open Python files, and edit PY files on Windows 10. This open-source tool has a simple interface and it is intended to use for beginners. It comes with pre-added Python 3.7, so you can run Python script without installing a Python Interpreter separately.
Apart from that, it has many other useful features that make it a better than basic Python viewer tool. You can show/hide outlines, variables, program tree, etc., using the View menu, select Interpreter (default or other available), run script, and debug the current script using the Run menu, code completion suggestion, etc. The feature to automatically highlight syntax errors (like unclosed quotes or parentheses) is also there.
Grab this tool using this link. After opening the interface, use the File menu to create a new file or add an existing PY file. You can also open multiple Python scripts on separate tabs. After that, you just need to explore and use options present in different menus and make the most of it.
Read Also: How to install NumPy using PIP on Windows 10.
4] Notepad++
Notepad++ is a very versatile source code editor and text editor. It supports a wide range of formats to open a normal text file, programming files (like C++, C#, etc.), Java files, JSON, LaTeX, Windows PowerShell files, etc. This is also a good option to open and edit PY files. You can also check the total number of lines, selected lines, and column number where the mouse cursor is available.
This software provides syntax highlighting for PY files, tabbed interface to open multiple Python files on different tabs, start and stop macro recording, etc. You can also run a Python script using the Run menu and providing the path of the Python interpreter installed on your PC.
Grab Notepad++ from here. After downloading the portable or installer version of Notepad++, launch its, and use the File menu to add a Python file. After that, its content is visible which you can edit as per the requirement. After that, you can save the file or a copy of the Python file using the same menu.
5] Atom
Atom is an open-source text and code editor software which is developed by GitHub. It supports Markdown and other code files and the PY file is also supported. The interface is user-friendly where you can open multiple PY files and edit them. It comes with text selection, text auto-complete, line numbers, enable/disable tree view, code folding, increase/decrease text size, change text case, and other options.
Its download link is here. After launching it, you can open a PY file or a project. Once the file is added, you can start the editing, and use the options available in different menus. You can also change its default theme by accessing Settings using the File menu.
The settings page also helps you install packages for Python files. For example, you can search for and install the python-debugger package. After that, you can use the Packages menu and use Python file debugger by adding input arguments and debugger commands.
You can find and install more packages such as format Python code, run Python file in terminal, add docstrings to Python, etc., to make it more useful for PY script files.
These are some good tools that you can use to open Python PY files in Windows 10 PC. Though Python IDE programs are better to use, simple text and code editor tools also serve the purpose of opening PY files in Windows PC quite well. Hope these Python file viewers will help.
TIP: here are some of the best websites to learn or improve your HTML coding knowledge.