Re: 请教一个怪问题
Lich_Ray <[email protected]> Wed, 23 Jan 2008 20:36:21 +0800
| Newsgroups | gmane.comp.python.chinese |
|---|---|
| Message-ID | <[email protected]> |
把 import 的过程去掉,直接在 Python 解释器里执行:
>>> Host = "http://www.163.com"
>>> Hosts = {"site":[Host,]}
>>> Host ="http://www.google.com"
>>> Hosts
{'site': ['http://www.163.com']}
然后想想为什么。
在08-1-23,fuyu0123456789 <[email protected]> 写道:
>
> 各位
>
> 又碰到一个怪问题,请看下面的3个Python文件
>
> main.py:
>
> from a import *
>
> from b import *
>
>
>
> a.py:
>
> Host = "http://www.163.com"
>
> Hosts = {"site":[Host,]}
>
>
>
> b.py
>
> Host =" http://www.google.com"
>
>
>
> 在Shell环境下执行下列代码
>
> import main
>
> main.Hosts
>
>
>
> 但是输出结果是
>
> {'site': ['http://www.163.com']}
>
>
>
> 按我的理解应该是
>
> {'site':['http://www.google.com']}
>
>
>
> 请问是怎么回事啊???
>
>
>
>
>
> ------------------------------
> 美利山开盘3000人抢购!440套售罄,加推300套17号开始登记!<http://popme.163.com/link/003865_0118_1005.html>
> _______________________________________________
> python-chinese
> Post: send [email protected]
> Subscribe: send subscribe to [email protected]
> Unsubscribe: send unsubscribe to [email protected]
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
--
Ray Stinger, nickname Lich_Ray
God is in his heaven, all's right with the world.
-------------------------------------------------
let focus = 'computing' in where:
http://lichray.javaeye.com
let focus = 'computing' in here:
http://inblogs.net/let-in
_______________________________________________
python-chinese
Post: send [email protected]
Subscribe: send subscribe to [email protected]
Unsubscribe: send unsubscribe to [email protected]
Detail Info: http://python.cn/mailman/listinfo/python-chinese