Python是否等同于Perl BEGIN {}块? [英] Is there Python equivalent to Perl BEGIN{} block?

查看:77
本文介绍了Python是否等同于Perl BEGIN {}块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


主题说几乎所有,我非常感谢答案。我b $ b试图搜索各个论坛和小组,但没有找到任何

具体答案......


谢谢,

Alex。

Hi all,

The subject says pretty much all, i would very appreciate an answer. I
tried to search the various forums and groups, but didn''t find any
specific answer...

Thanks,
Alex.

推荐答案

3月12日下午6:19,Alex< alex.pul .. 。@ gmail.comwrote:
On Mar 12, 6:19 pm, Alex <alex.pul...@gmail.comwrote:

大家好,


主题说几乎所有,我非常感谢答案。我b $ b试图搜索各个论坛和小组,但没有找到任何

具体答案......


谢谢,

Alex。
Hi all,

The subject says pretty much all, i would very appreciate an answer. I
tried to search the various forums and groups, but didn''t find any
specific answer...

Thanks,
Alex.



不是不是真的。


虽然有很多其他方法可以构建Python程序

,几乎感觉不到它。


- Paddy。

No not really.

There are lots of other ways to structure a Python program though
which makes its omission hardly felt.

- Paddy.


主题说几乎所有,


鉴于我对BEGIN块[1]的理解,这就是蟒蛇自动生成的方式:


bash
The subject says pretty much all,

Given what I understand about the BEGIN block[1], this is how
Python works automatically:

bash


cat a.py

打印''a1''

导入b

打印''a2' '


bash
cat a.py
print ''a1''
import b
print ''a2''

bash


这篇关于Python是否等同于Perl BEGIN {}块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆