有没有办法:
- 始终默认启用
-t(警告标签使用不一致) - 能够在启动时以编程方式启用它(例如,在
sitecustomize.py模块中)
它也需要为嵌入式 Python 工作(因此别名 python 或类似的解决方案将没有用)。 sitecustomize.py 的使用允许我们连接到嵌入式 Python 实例,因此这似乎是一个适合它的地方。
我认为 warnings 模块会提供一种方法来打开此警告,但我没有看到任何东西。
供引用:
usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Options and arguments (and corresponding environment variables):
...
-t : issue warnings about inconsistent tab usage (-tt: issue errors)
...
关于如何做到这一点有什么建议吗?
谢谢。
请您参考如下方法:
没有这样的选项。
你可以
- 将解释器调用包装在 bash 脚本中
- 定义别名
