2.1 运行hello_world.py时发生的情况

这篇博客介绍了Python程序的运行过程,以hello_world.py为例,解释了.py文件如何被Python解释器读取并执行。当遇到print语句时,解释器会将内容输出到屏幕。文章揭示了Python解释器在执行简单程序时的幕后工作。

hell_word.py

实际上,即使运行简单的程序,python所做的工作也相当多。
print("Hello world!")
运行hello_world.py时,末尾的.py指出这是一个python程序,因此编辑器使用python解释器来运行它。python解释器读取整个程序,确定其每个单词的含义。例如,看到单词print时,解释器就会将括号中的内容打印到屏幕,而不会管括号中的内容是什么。

C:\Users\EDY\miniconda3\envs\map_ocr_project\python.exe -X pycache_prefix=C:\Users\EDY\AppData\Local\JetBrains\PyCharmCE2023.2\cpython-cache "C:/Program Files/JetBrains/PyCharm Community Edition 2023.2.5/plugins/python-ce/helpers/pydev/pydevd.py" --multiprocess --qt-support=auto --client 127.0.0.1 --port 50417 --file D:\project\map_ocr\Map_project\demo_app\app.py 已连接到 pydev 调试器(内部版本号 232.10227.11)map_ocr/models/R50_map_v2.1/model_final.pth 2025-03-24 11:13:57,016 - INFO - [DetectionCheckpointer] Loading from map_ocr/models/R50_map_v2.1/model_final.pth ... 2025-03-24 11:13:57,016 - INFO - [Checkpointer] Loading from map_ocr/models/R50_map_v2.1/model_final.pth ... C:\Users\EDY\miniconda3\envs\map_ocr_project\lib\site-packages\fvcore\common\checkpoint.py:252: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature. return torch.load(f, map_location=torch.device("cpu")) * Serving Flask app 'app' * Debug mode: on 2025-03-24 11:13:58,065 - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Running on all addresses (0.0.0.0) * Running on http://127.0.0.1:5000 * Running on http://127.0.0.1:5000 2025-03-24 11:13:58,065 - INFO - Press CTRL+C to quit 2025-03-24 11:13:58,074 - INFO - * Restarting with stat No module named app 进程已结束,退出代码为 0 怎么解决
最新发布
03-25
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值