Jump to content
彼岸论坛
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[Python] 技术求助: Python 启动文件识别


Recommended Posts

Posted

python 的 Sitecustomize 可以在 python 运行前执行一些前置任务, 但是如何获取本次启动 Python 时,运行的是哪个脚本或模块?

比如 Python test.py , 如何在 sitecustomize 中获取 test.py 这个文件名?

sys.argv 似乎接收不到这个文件名。

说起来,除了 python test.py 这种在命令行后跟文件名的启动方式外,还有别的吗?

  • 游客注册

    游客注册

  • Members

    No members to show

  • Recent Status Updates

    No Recent Status Updates
  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...