在windows中使用/example/example.py打开每个.example文件

2024-10-02 08:26:03 发布

您现在位置:Python中文网/ 问答频道 /正文

我想制作一种带有文件(.example)特定结尾的编程语言,它可以位于每个文件夹中,并由python文件(example/example.py)执行。example文件所在的参数是python文件可以打开它

我已经尝试过在普通Windows设置和.itselfs示例(打开时使用)中进行设置,但没有机会使其工作


Tags: 文件py文件夹示例参数examplewindows结尾
1条回答
网友
1楼 · 发布于 2024-10-02 08:26:03

解决方案

  • 可以使用Windows的文件关联功能在Windows python中运行任意自定义文件扩展名

逐步(Windows 7)

  • 创建新的文件扩展名
  • 像往常一样打开文件
  • 您将看到unable to find software to open this file
  • 选择search through windows
  • 选择Select a program from a list of installed programs
  • 选择Always use the selected program to open this kind of file
  • 导航到包含pythonw.exe的目录

截图

  • screenshot of windows file association step

相关问题 更多 >

    热门问题