提示信息

Python __file__

流浪汉 已关注

The __file__ attribute in Python is a built-in variable that represents the path of the Python script that is currently being executed. It provides the absolute path of the script, including the script's name.

Here's an example:

  1. print(__file__)

Output:

  1. /path/to/my_script.py

Note that the __file__ attribute is not available in the interactive Python shell (repl) as there is no script being executed.

    遇到难题? "AI大模型GPT4.0、GPT" 是你的私人解答专家! 点击按钮去提问......
流浪汉 关注 已关注

最近一次登录:2023-10-09 16:15:58   

暂时还没有签名,请关注我或评论我的文章
×
免费图表工具,画流程图、架构图