Python论坛  - 讨论区

标题:[python-chinese] python环境的问题

2006年09月12日 星期二 15:06

chenwei chenwei在sobey.com
星期二 九月 12 15:06:33 HKT 2006

§+a¢zr³+)jØg{ij»@œtÌ-«miÈfz{pjË®æÛyÕ.m§ÿéÊØhÉÿ¦*^®f¢—úr¶'r§zÇ¿jÛZržžÛ?ÛM:ÓÝvÿ®u§øoö­µ§!™éí†Ù¥

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

2006年09月12日 星期二 16:30

chenwei chenwei在sobey.com
星期二 九月 12 16:30:10 HKT 2006

各位帮帮忙,谢谢了
  ----- Original Message ----- 
  From: chenwei 
  To: python-chinese at lists.python.cn 
  Sent: Tuesday, September 12, 2006 3:06 PM
  Subject: [python-chinese] python环境的问题


  请问python的环境路径应该怎么设置?指明需要包含的py库的位置。

  我用sys.path可以临时添加,但是重启解释器就失效了。。。


------------------------------------------------------------------------------


  _______________________________________________
  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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://python.cn/pipermail/python-chinese/attachments/20060912/e5a67a14/attachment.html 

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

2006年09月12日 星期二 16:37

zerocp zero在rsslife.net
星期二 九月 12 16:37:14 HKT 2006

ENVIRONMENT VARIABLES
       PYTHONHOME
              Change the  location  of  the  standard  Python  libraries.   By
              default, the libraries are searched in ${prefix}/lib/python and  ${exec_prefix}/lib/python,  where  ${prefix}
              and  ${exec_prefix} are installation-dependent directories, both
              defaulting to /usr/local.  When $PYTHONHOME is set to  a  single
              directory, its value replaces both ${prefix} and ${exec_prefix}.
              To specify different values for these, set $PYTHONHOME to ${pre-
              fix}:${exec_prefix}.
 
       PYTHONPATH
              Augments  the  default search path for module files.  The format
              is the same as the shell's $PATH: one or  more  directory  path-
              names   separated   by  colons.   Non-existent  directories  are
              silently ignored.   The  default  search  path  is  installation
              dependent,  but  generally begins with ${prefix}/lib/python (see PYTHONHOME above).  The default search path is always
              appended  to  $PYTHONPATH.   If  a script argument is given, the
              directory containing the script is inserted in the path in front
              fix}:${exec_prefix}.
 
       PYTHONPATH
              Augments  the  default search path for module files.  The format
              is the same as the shell's $PATH: one or  more  directory  path-
              names   separated   by  colons.   Non-existent  directories  are
              silently ignored.   The  default  search  path  is  installation
              dependent,  but  generally begins with ${prefix}/lib/python (see PYTHONHOME above).  The default search path is always
              appended  to  $PYTHONPATH.   If  a script argument is given, the
              directory containing the script is inserted in the path in front
              of  $PYTHONPATH.  The search path can be manipulated from within
              a Python program as the variable sys.path .
 
       PYTHONSTARTUP
              If this is the name of a readable file, the Python  commands  in
              that  file  are executed before the first prompt is displayed in
              interactive mode.  The file is executed in the same  name  space
              where  interactive commands are executed so that objects defined
              or imported in it can  be  used  without  qualification  in  the
              interactive  session.   You  can also change the prompts sys.ps1
              and sys.ps2 in this file.
 
       PYTHONY2K
              Set this to a non-empty string  to  cause  the  time  module  to
              require  dates  specified  as  strings to include 4-digit years,
              otherwise 2-digit years are converted based on  rules  described
              in the time module documentation.
 
       PYTHONOPTIMIZE
              If  this is set to a non-empty string it is equivalent to speci-
              fying the -O option. If set to an integer, it is  equivalent  to
              specifying -O multiple times.
 
       PYTHONDEBUG
              If  this is set to a non-empty string it is equivalent to speci-
              fying the -d option. If set to an integer, it is  equivalent  to
              specifying -d multiple times.
 
       PYTHONINSPECT
              If  this is set to a non-empty string it is equivalent to speci-
              fying the -i option.
 
       PYTHONUNBUFFERED
              If this is set to a non-empty string it is equivalent to  speci-
              fying the -u option.
 
       PYTHONVERBOSE
              If  this is set to a non-empty string it is equivalent to speci-
              fying the -v option. If set to an integer, it is  equivalent  to
              specifying -v multiple times.



> 各位帮帮忙,谢谢了
>   ----- Original Message ----- 
>   From: chenwei 
>   To: python-chinese在lists.python.cn 
>   Sent: Tuesday, September 12, 2006 3:06 PM
>   Subject: [python-chinese] python环境的问题
> 
> 
>   请问python的环境路径应该怎么设置?指明需要包含的py库的位置。
> 
>   我用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

-- 
zerocp <zero在rsslife.net>


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

2006年09月12日 星期二 16:46

邓作霖 pse-dengzl在pegasus.tj.cn
星期二 九月 12 16:46:56 HKT 2006

大家好;

     我想匹配一个字符串,比如“TEST(323233)”,想提取括号中的数值,正则表 
达式写为 re.compile(r'\b\([0-9][0-9][0-9][0-9][0-9][0-9]\),但是没办法匹 
配,而使用RegexBuilder这个软件时就没有问题,请问我哪个地方错了,多谢了。

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

2006年09月12日 星期二 17:03

limodou limodou在gmail.com
星期二 九月 12 17:03:23 HKT 2006

On 9/12/06, 邓作霖 <pse-dengzl在pegasus.tj.cn> wrote:
> 大家好;
>
>      我想匹配一个字符串,比如"TEST(323233)",想提取括号中的数值,正则表
> 达式写为 re.compile(r'\b\([0-9][0-9][0-9][0-9][0-9][0-9]\),但是没办法匹
> 配,而使用RegexBuilder这个软件时就没有问题,请问我哪个地方错了,多谢了。

r'\d+'


-- 
I like python!
My Blog: http://www.donews.net/limodou
UliPad Site: http://wiki.woodpecker.org.cn/moin/UliPad
UliPad Maillist: http://groups.google.com/group/ulipad

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

2006年09月12日 星期二 17:08

zerocp zero在rsslife.net
星期二 九月 12 17:08:18 HKT 2006

re.match(r'\D+(\d+)', "TEST(323233)").group(1)
-- 
zerocp <zero在rsslife.net>


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

2006年09月12日 星期二 17:11

limodou limodou在gmail.com
星期二 九月 12 17:11:52 HKT 2006

On 9/12/06, zerocp <zero在rsslife.net> wrote:
> re.match(r'\D+(\d+)', "TEST(323233)").group(1)

用search()就简单了。

 >>> import re
 >>> re.search(r'\d+', 'TEST(323233)').group()
 '323233'

-- 
I like python!
My Blog: http://www.donews.net/limodou
UliPad Site: http://wiki.woodpecker.org.cn/moin/UliPad
UliPad Maillist: http://groups.google.com/group/ulipad

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

2006年09月12日 星期二 17:26

jetrix chan jetrixc在gmail.com
星期二 九月 12 17:26:29 HKT 2006

export PYTHONPATH="your path"

在06-9-12,chenwei <chenwei在sobey.com> 写道:
>
> 各位帮帮忙,谢谢了
> ----- Original Message -----
> *From:* chenwei <chenwei在sobey.com>
> *To:* python-chinese在lists.python.cn
> *Sent:* Tuesday, September 12, 2006 3:06 PM
> *Subject:* [python-chinese] python环境的问题
>
> 请问python的环境路径应该怎么设置?指明需要包含的py库的位置。
>
> 我用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
>
> _______________________________________________
> 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
>



-- 
Best Regards,
         Jetrix Chan
----
jetrixc在gmail.com
-------------- 下一部分 --------------
一个HTML附件被移除...
URL: http://python.cn/pipermail/python-chinese/attachments/20060912/91e97612/attachment.htm 

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

2006年09月12日 星期二 17:31

chenwei chenwei在sobey.com
星期二 九月 12 17:31:44 HKT 2006

忘了说,我用的pythonwin
  ----- Original Message ----- 
  From: chenwei 
  To: python-chinese at lists.python.cn 
  Sent: Tuesday, September 12, 2006 4:30 PM
  Subject: Re: [python-chinese] python环境的问题


  各位帮帮忙,谢谢了
    ----- Original Message ----- 
    From: chenwei 
    To: python-chinese at lists.python.cn 
    Sent: Tuesday, September 12, 2006 3:06 PM
    Subject: [python-chinese] python环境的问题


    请问python的环境路径应该怎么设置?指明需要包含的py库的位置。

    我用sys.path可以临时添加,但是重启解释器就失效了。。。


----------------------------------------------------------------------------


    _______________________________________________
    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


------------------------------------------------------------------------------


  _______________________________________________
  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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://python.cn/pipermail/python-chinese/attachments/20060912/67f3a918/attachment.html 

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

2006年09月12日 星期二 18:14

chenwei chenwei在sobey.com
星期二 九月 12 18:14:04 HKT 2006

谢谢回答。
不过export在python解释器里面报未定义
  ----- Original Message ----- 
  From: jetrix chan 
  To: python-chinese at lists.python.cn 
  Sent: Tuesday, September 12, 2006 5:26 PM
  Subject: Re: [python-chinese] python环境的问题


  export PYTHONPATH="your path"


  在06-9-12,chenwei <chenwei at sobey.com> 写道:
    各位帮帮忙,谢谢了
    ----- Original Message ----- 
    From: chenwei 
    To: python-chinese at lists.python.cn 
    Sent: Tuesday, September 12, 2006 3:06 PM
    Subject: [python-chinese] python环境的问题


    请问python的环境路径应该怎么设置?指明需要包含的py库的位置。 

    我用sys.path可以临时添加,但是重启解释器就失效了。。。


----------------------------------------------------------------------------
    _______________________________________________
    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


    _______________________________________________ 
    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




  -- 
  Best Regards,
           Jetrix Chan
  ----
  jetrixc at gmail.com 


------------------------------------------------------------------------------


  _______________________________________________
  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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://python.cn/pipermail/python-chinese/attachments/20060912/b0210fdf/attachment.html 

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

2006年09月12日 星期二 18:36

zerocp zero在rsslife.net
星期二 九月 12 18:36:07 HKT 2006

> 谢谢回答。
> 不过export在python解释器里面报未定义
1. export 是 bash/sh 的一个内置命令,不是python的builtins
2. windows下环境变量不会设?
3. 给你贴了一份完整的 python 用得到的 environment variables,你没有看?

btw: 英文不好看不懂不是理由

>   ----- Original Message ----- 
>   From: jetrix chan 
>   To: python-chinese在lists.python.cn 
>   Sent: Tuesday, September 12, 2006 5:26 PM
>   Subject: Re: [python-chinese] python环境的问题
> 
> 
>   export PYTHONPATH="your path"
> 
> 
>   在06-9-12,chenwei <chenwei在sobey.com> 写道:
>     各位帮帮忙,谢谢了
>     ----- Original Message ----- 
>     From: chenwei 
>     To: python-chinese在lists.python.cn 
>     Sent: Tuesday, September 12, 2006 3:06 PM
>     Subject: [python-chinese] python环境的问题
> 
> 
>     请问python的环境路径应该怎么设置?指明需要包含的py库的位置。 
> 
>     我用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
> 
> 
>     _______________________________________________ 
>     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
> 
> 
> 
> 
>   -- 
>   Best Regards,
>            Jetrix Chan
>   ----
>   jetrixc在gmail.com 
> 
> 
> ------------------------------------------------------------------------------
> 
> 
>   _______________________________________________
>   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

-- 
zerocp <zero在rsslife.net>


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

2006年09月13日 星期三 09:01

邓作霖 pse-dengzl在pegasus.tj.cn
星期三 九月 13 09:01:14 HKT 2006

我明白了,非常感谢大家。

limodou wrote:
> On 9/12/06, zerocp <zero at rsslife.net> wrote:
>   
>> re.match(r'\D+(\d+)', "TEST(323233)").group(1)
>>     
>
> 用search()就简单了。
>
>  >>> import re
>  >>> re.search(r'\d+', 'TEST(323233)').group()
>  '323233'
>
>   


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

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

    你的回复:

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

    Zeuux © 2025

    京ICP备05028076号