是否有 python 3 文件扩展名与 *.py 扩展名完全一样?

Is there a python 3 file extension that acts exactly like a *.py extension?

我正在python写一个开源项目,为了让其他开发者更容易添加到它,我想让我所有的代码都有另一个文件扩展名,所以我的 installer/updater 可以区分我的文件和其他开发人员的文件(这些对于他们的计算机来说是独一无二的)。安装程序会做的是删除我所有的程序文件,然后下载最新的并将它们放在目录中。为了使这些文件结合起来,在我的主程序的末尾,我会添加几行代码来检查其他开发人员文件中的任何条件是否发生(我正在使用中文房间思想制作数字助理实验作为基础,所以主程序基本上是数百个ifelifelse语句,指向模块告诉主程序做什么。

"Is there a python 3 file extension that acts exactly like a *.py extension?"

不,据我所知没有。如果您想通过创建自己的文件扩展名 (?!) 来实现 "version control",您可以像这样使用 imp 模块:

Python 3.4.3 解释器输出:

>>> import imp
>>> my_module = imp.load_source("My custom module", "my_module.some_extension")
>>> my_module
<module 'My custom module' from 'my_module.some_extension'>
>>> dir(my_module)
['__builtins__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'func']
>>> my_module.func()
my module says hi!
>>> 

my_module.some_extension:

def func():
    print("my module says hi!")