2006年10月22日 星期日 15:25
linda.s 写道: > 我有一个代码叫a.py,它在 > c:\test1\new下,我怎么去调用(import b) > c:\test2下的b.py? > 还有一件奇怪的事情:我在a.py里 > import c(没有错误,但是c.py在桌面上,根本不在一个目录里), > 为什么? > Linda > _______________________________________________ > 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 如果你用的是idle,他会把你的python目录,以及你保存你在编辑的文件的目录, 都加入到你的sys.path中去的
2006年10月22日 星期日 15:36
如题
2006年10月22日 星期日 16:37
1,import 去找你的默认目录, 看看你的默认目录
>>> import sys
>>> sys.path
['C:\\Python25\\Lib\\idlelib', 'C:\\WINDOWS\\system32\\python25.zip',
'C:\\Python25\\DLLs', 'C:\\Python25\\lib', 'C:\\Python25\\lib\\plat-win',
'C:\\Python25\\lib\\lib-tk', 'C:\\Python25',
'C:\\Python25\\lib\\site-packages', 'C:\\Python25\\lib\\site-packages\\wx-
2.6-msw-unicode']
2,想添加一个新的import目录
sys.path.append('C:\\NEW')
2006/10/22, hailang_0512 <hailang_0512在163.com>:
>
> linda.s 写道:
> > 我有一个代码叫a.py,它在
> > c:\test1\new下,我怎么去调用(import b)
> > c:\test2下的b.py?
> > 还有一件奇怪的事情:我在a.py里
> > import c(没有错误,但是c.py在桌面上,根本不在一个目录里),
> > 为什么?
> > Linda
> > _______________________________________________
> > 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
> 如果你用的是idle,他会把你的python目录,以及你保存你在编辑的文件的目录,
> 都加入到你的sys.path中去的
>
>
> _______________________________________________
> 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
--
-- Jia LU
<http://www.lujia.us>
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p
in '001akor在liamg.moc'.split('@')])"
--
\ "Unix is an operating system, OS/2 is half an operating system, |
`\ Windows is a shell, and DOS is a boot partition virus." -- |
_o__) Peter H. Coffin |
-------------- 下一部分 --------------
一个HTML附件被移除...
URL: http://python.cn/pipermail/python-chinese/attachments/20061022/63590950/attachment.html
2006年10月22日 星期日 21:57
py类 指的是什么? python 吗? CPython 是用 C 语言写的, 没有类吧 On 10/22/06, hailang_0512 <hailang_0512 at 163.com> wrote: > 如题 > > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese
2006年10月22日 星期日 22:01
python 标准库 是吗? 好像也没 太多 继承 关系 On 10/22/06, lu <self.lu at gmail.com> wrote: > py类 指的是什么? > > python 吗? > > CPython 是用 C 语言写的, 没有类吧 > > On 10/22/06, hailang_0512 <hailang_0512 at 163.com> wrote: > > 如题 > > > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese at lists.python.cn > > Subscribe: send subscribe to python-chinese-request at lists.python.cn > > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese >
2006年10月22日 星期日 22:20
标准库里都是些相对小的工具。就算复杂一些的web框架,似乎也没有很深的继承关系。 -- http://codeplayer.blogspot.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://python.cn/pipermail/python-chinese/attachments/20061022/ca67c99a/attachment.html
2006年10月23日 星期一 19:20
我问的就是python的标准库
Zeuux © 2025
京ICP备05028076号