Python论坛  - 讨论区

标题:[python-chinese] 怎样遍历python中所有的有效变量和函

2007年09月03日 星期一 12:31

www hedogn在163.com
星期一 九月 3 12:31:17 HKT 2007

python-chinese,您好!
	怎样遍历python中所有的有效变量和函数,并得到变量的类型?
          2007-09-03

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年09月03日 星期一 15:15

HU Bo A Bo.a.Hu在alcatel-sbell.com.cn
星期一 九月 3 15:15:09 HKT 2007

是这个吗?

[(x,globals()[x].__class__.__name__) for x in globals().keys()] 

-----Original Message-----
From: python-chinese-bounces在lists.python.cn [mailto:python-chinese-bounces在lists.python.cn] On Behalf Of www
Sent: 2007年9月3日 12:31
To: python-chinese
Subject: [python-chinese] 怎样遍历python中所有的有效变量和函数

python-chinese,您好!
	怎样遍历python中所有的有效变量和函数,并得到变量的类型?
          2007-09-03
_______________________________________________
python-chinese
Post: send python-chinese在lists.python.cn
Subscribe: send subscribe to python-chinese-request在lists.python.cn
Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
Detail Info: http://python.cn/mailman/listinfo/python-chinese

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年09月05日 星期三 09:36

shhgs shhgs.efhilt在gmail.com
星期三 九月 5 09:36:05 HKT 2007

vars()

On 9/3/07, HU Bo A <Bo.a.Hu在alcatel-sbell.com.cn> wrote:
> 是这个吗?
>
> [(x,globals()[x].__class__.__name__) for x in globals().keys()]
>
> -----Original Message-----
> From: python-chinese-bounces在lists.python.cn [mailto:python-chinese-bounces在lists.python.cn] On Behalf Of www
> Sent: 2007年9月3日 12:31
> To: python-chinese
> Subject: [python-chinese] 怎样遍历python中所有的有效变量和函数
>
> python-chinese,您好!
>         怎样遍历python中所有的有效变量和函数,并得到变量的类型?
> 2007-09-03
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号