免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3513 | 回复: 3
打印 上一主题 下一主题

问个小问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-06-10 21:56 |只看该作者 |倒序浏览
我装的python2。4。1 for win 和pythonwin for2。4
在pythonwin的IDE中
import sys后
sys.exc_traceback
报Traceback (most recent call last):
  File "<interactive input>;", line 1, in ?
AttributeError: 'module' object has no attribute 'exc_traceback'

在python自带的IDLE中就可以,这是pythonwin的问题吗

论坛徽章:
0
2 [报告]
发表于 2005-06-10 23:03 |只看该作者

问个小问题

不关pythonwin的事吧,用python自带的也不行啊

你用dir(sys)比较一下

IDLE中

  1. >;>;>; import sys
  2. >;>;>; dir(sys)
  3. ['__displayhook__', '__doc__', '__excepthook__', '__name__', '__stderr__', '__stdin__', '__stdout__', '_getframe', 'api_version', 'argv', 'builtin_module_names', 'byteorder', 'call_tracing', 'callstats', 'copyright', 'displayhook', 'dllhandle', 'exc_clear', 'exc_info', 'exc_traceback', 'exc_type', 'exc_value', 'excepthook', 'exec_prefix', 'executable', 'exit', 'exitfunc', 'getcheckinterval', 'getdefaultencoding', 'getfilesystemencoding', 'getrecursionlimit', 'getrefcount', 'getwindowsversion', 'hexversion', 'maxint', 'maxunicode', 'meta_path', 'modules', 'path', 'path_hooks', 'path_importer_cache', 'platform', 'prefix', 'setcheckinterval', 'setprofile', 'setrecursionlimit', 'settrace', 'stderr', 'stdin', 'stdout', 'version', 'version_info', 'warnoptions', 'winver']
复制代码


Pythonwin中
  1. >;>;>; import sys
  2. >;>;>; dir(sys)
  3. ['__displayhook__', '__doc__', '__excepthook__', '__name__', '__stderr__', '__stdin__', '__stdout__', '_getframe', 'api_version', 'appargv', 'appargvoffset', 'argv', 'builtin_module_names', 'byteorder', 'call_tracing', 'callstats', 'copyright', 'displayhook', 'dllhandle', 'exc_clear', 'exc_info', 'exc_type', 'excepthook', 'exec_prefix', 'executable', 'exit', 'getcheckinterval', 'getdefaultencoding', 'getfilesystemencoding', 'getrecursionlimit', 'getrefcount', 'getwindowsversion', 'hexversion', 'last_traceback', 'last_type', 'last_value', 'maxint', 'maxunicode', 'meta_path', 'modules', 'path', 'path_hooks', 'path_importer_cache', 'platform', 'prefix', 'ps1', 'ps2', 'setcheckinterval', 'setprofile', 'setrecursionlimit', 'settrace', 'stderr', 'stdin', 'stdout', 'version', 'version_info', 'warnoptions', 'winver']
复制代码


文档里说exc_traceback已经不建议使用了Deprecated

论坛徽章:
0
3 [报告]
发表于 2005-06-11 08:27 |只看该作者

问个小问题

喔,不过怎么会一个语言在不同的IDE里面表现不同呢,它们难道不是调用一个底层吗,每个IDE自己在控制python的语法吗,应该不会吧。

论坛徽章:
0
4 [报告]
发表于 2005-06-13 11:45 |只看该作者

问个小问题

pythonwin和python不一样的。
python的可移植性要强些。pythonwin有些模块是重写过的。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP