Python论坛  - 讨论区

标题:Re: Re: [python-chinese] Re: 听CPUG 录音

2005年08月30日 星期二 14:52

icebird icebirds at gmail.com
Tue Aug 30 14:52:40 HKT 2005

=======引用watchsun于05-8-30 14:20 14:20:17所说:=======

文件太大了,能否将MP3做的小一点,比如降低采样频率等


=============引用结束=================

建议以后使用OGG格式来压缩音频。这种音频用foobar就可以播放。降低采样率
后压缩比也更理想一些。其实SC4和VYF更猛,但我不知道怎么压缩的。

        icebird
        icebirds at gmail.com
          2005-08-30


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

2005年08月30日 星期二 15:02

Zoom Quiet zoom.quiet at gmail.com
Tue Aug 30 15:02:00 HKT 2005

在 05-8-30,icebird<icebirds at gmail.com> 写道:
> =======引用watchsun于05-8-30 14:20 14:20:17所说:=======
> 
> 文件太大了,能否将MP3做的小一点,比如降低采样频率等
> 
> =============引用结束=================
> 
> 建议以后使用OGG格式来压缩音频。这种音频用foobar就可以播放。降低采样率
> 后压缩比也更理想一些。其实SC4和VYF更猛,但我不知道怎么压缩的。
直接使用 foobar2000 就可以进行转换的

>         icebird
>         icebirds at gmail.com
>           2005-08-30
> 
> 
> _______________________________________________
> python-chinese list
> python-chinese at lists.python.cn
> http://python.cn/mailman/listinfo/python-chinese
> 
> 
> 


-- 
[Time is unimportant, only life important!]

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

2005年08月30日 星期二 15:02

rocker rockety at 126.com
Tue Aug 30 15:02:10 HKT 2005

su suyushi2004,您好!

	感激ing

======= 2005-08-30 13:03:02 您在来信中写道:=======

>www.linuxabc.net这里免费下你要的那本书。另外用超新星不好用 就用BooX Viewer 来阅读。
>_______________________________________________
>python-chinese list
>python-chinese at lists.python.cn
>http://python.cn/mailman/listinfo/python-chinese
>

= = = = = = = = = = = = = = = = = = = =
			

        致
礼!
 
				 
        rocker
        rockety at 126.com
          2005-08-30

-------------- next part --------------
A non-text attachment was scrubbed...
Name: face-3.gif
Type: image/gif
Size: 842 bytes
Desc: not available
Url : http://lists.exoweb.net/pipermail/python-chinese/attachments/20050830/edbc35b1/face-3.gif

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

2005年08月30日 星期二 15:30

saddle saddle at gmail.com
Tue Aug 30 15:30:20 HKT 2005

不要再压缩了吧, 很长时间才有一次听的
另外, uc上平时没有人说话....

在 05-8-30,Zoom Quiet<zoom.quiet at gmail.com> 写道:
> 在 05-8-30,icebird<icebirds at gmail.com> 写道:
> > =======引用watchsun于05-8-30 14:20 14:20:17所说:=======
> >
> > 文件太大了,能否将MP3做的小一点,比如降低采样频率等
> >
> > =============引用结束=================
> >
> > 建议以后使用OGG格式来压缩音频。这种音频用foobar就可以播放。降低采样率
> > 后压缩比也更理想一些。其实SC4和VYF更猛,但我不知道怎么压缩的。
> 直接使用 foobar2000 就可以进行转换的
> 
> >         icebird
> >         icebirds at gmail.com
> >           2005-08-30
> >
> >
> > _______________________________________________
> > python-chinese list
> > python-chinese at lists.python.cn
> > http://python.cn/mailman/listinfo/python-chinese
> >
> >
> >
> 
> 
> --
> [Time is unimportant, only life important!]
> 
> _______________________________________________
> python-chinese list
> python-chinese at lists.python.cn
> http://python.cn/mailman/listinfo/python-chinese
> 
> 
>

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

2005年08月30日 星期二 15:52

Jerry jetport at gmail.com
Tue Aug 30 15:52:19 HKT 2005

11khz,96kbps
downloaded into my iriver

-- 
If U can see it, then U can do it
If U just believe it, there's nothing to it
I believe U can fly 
>From Jetport at gmail.com

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

2005年08月30日 星期二 15:57

slowness_chen chenzh at bhh.com.cn
Tue Aug 30 15:57:21 HKT 2005

为了察看从sf上下载的源代码包readme写的一个小脚本
用法:python sfprjintro.pt rootpath
察看在rootpath下生成的__readme__.html即可
-------------- next part --------------
#sfprjintro.py v1.0
#author: slowness chen
#any question, mail to slowness.chen at gmail.com please

from zipfile import ZipFile
import tarfile
import os
import os.path
import re
import sfprjintrotpl as tpl
import string
import time
import sys

BRIEF_LINES = 10
readme_plain = ['readme','readme.txt']
readme_html = ['readme.html','readme.htm']
patbody = re.compile(r'(.*)',re.S)
patname = re.compile(r'(\w+)')

def sfprjintro(root= os.getcwd()): 
    """extract readmes from zips or tag.gzs
    in the rootpath file tree, and build what
    are extracted into one html page"""

    #get rootpath if users have defined
    if len(sys.argv[1:]) > 0 :
        if not os.path.isdir(sys.argv[1]):
            print 'rootpath is not correct!'
            return
        root = sys.argv[1]

    #get intros from packages
    intros = []
    targznames = getfiles(root,['.gz'])
    for targz in targznames:
        intros.append(readtarorzip(targz))
    zipnames = getfiles(root,['.zip'])
    for zipname in zipnames:
        intros.append(readtarorzip(zipname,istar=0)) 

    #build into a html page
    foundnum = len([intro for intro in intros if intro[1] != '-'])
    if foundnum > 0:
        print 'found %d introductions.' % foundnum
        intro2html(intros,root,foundnum)
    else:
        print 'no introduction found!'

def intro2html(intros,root,foundnum):
    """organize readmes into one html page"""
    #use string.Template object new in python 2.4

    #handle html head
    t = string.Template(tpl.head)    
    moditime = time.strftime('%Y-%m-%d,%H:%M:%S',time.localtime())
    headstr = t.safe_substitute({'modifiedtime':moditime,'rootpath':root,
             'foundnum':str(foundnum),'totalnum':str(len(intros))})
    headstr = [headstr]
    
    #handle html body
    briefstr = []
    detailstr = []
    tw = string.Template(tpl.wholereadme)
    itemid = 1
    for intro in intros:
        if intro[1] == '-':
            tb = string.Template(tpl.nobriefreadme)  
        else:
            tb = string.Template(tpl.briefreadme)
        tmp = tb.safe_substitute( {'prjname':intro[0],
                'intro':intro[1],'itemid':itemid, 'itemid2':str(itemid)+'-'+str(itemid) } )
        briefstr.append(tmp)
        if intro[2] != '-':
            tmp = tw.safe_substitute( {'prjname':intro[0],
                'content':intro[2],'itemid':itemid, 'itemid2':str(itemid)+'-'+str(itemid)} )
            detailstr.append(tmp)            
        itemid += 1

    #build __readme__.html in rootpath
    htmlpath = os.path.join(root, '__readme__.html') 
    try:
        f = open(htmlpath,'w')
        f.writelines(headstr + briefstr + detailstr + [tpl.tail])
    except IOError,e:
        print e
    else:
        f.close() 

def readtarorzip(zname,istar = 1):
    """read zip/tar.gz,return a list as 
    [prjname,brief,detail]"""

    #get project name from packge name   
    prjname = getprjname(os.path.split(zname)[1])

    #get namelist of the package
    zintro = []
    if istar:
        try:
            fo = tarfile.open(zname,'r:gz') 
        except IOError,e:
            print e
            return [prjname,'-','-']
        namelist = fo.getnames()
        #to get readme from root first
        namelist.reverse()
    else:
         try:
            fo = ZipFile(zname)
         except IOError,e:
            print e
            return [prjname,'-','-']   
         namelist = fo.namelist() 
    
    #read from package
    for name in namelist:
        is_readme_plain = 0
        is_readme_html = 0
        for form in readme_plain :
            is_readme_plain = is_readme_plain or name.lower().endswith(form) 
        for form in readme_html :
            is_readme_html = is_readme_html or name.lower().endswith(form) 
        if is_readme_plain or is_readme_html:           
            if istar:               
                content = fo.extractfile(name).read()                
            else:
                content = fo.read(name)
            if is_readme_plain:
                lines = content.split('\n')  
            elif is_readme_html:
                lines = cvthtml(content,prjname)  
            intro = extractintro(lines,prjname) 
            zintro=[prjname,intro,content]
            break

    #if no readme     
    if zintro == []:
        zintro=[prjname,'-','-']

    fo.close()
    return zintro

def cvthtml(htmlcontent,prjname):
    """extract body from htmlcontent"""

    m = re.search(patbody,htmlcontent)
    if m is not None:
        bodycontent = m.group(1)
        return [bodycontent]
    else:
        print "cannot parse  %s's readme! " % prjname
        return '-'    

def getprjname(pkgname):
    """extract project name from 
    zip/tar.gz file name"""  

    m = re.search(patname,pkgname)
    if m is not None:
        prjname = m.group(1)
        return prjname
    else:
        print 'cannot get prjnam from package : %s' % pkgname
        return '-'    

def extractintro(lines,prj):
    """extract the first BRIEF_LINES non-empty lines
    from readme file"""
    
    intro = ' '
    lines = [line for line in lines if line.strip()]
    try:
        for i in range(BRIEF_LINES):
            intro += lines[i] + '\n'        
    except IndexError:               
        pass
    return intro

def visit(args, dirname, names):       
    for name in names:
        if os.path.isdir(os.path.join(dirname,name)):
            continue
        if not args[1]:    
            fullpath = os.path.join(dirname,name)
            args[0].append(fullpath)
        elif os.path.splitext(name)[1].lower() in args[1]: 
            fullpath = os.path.join(dirname,name)
            args[0].append(fullpath)

def getfiles(root,filetypes=[]):
    """get all files as a list if 
    filetype in filetypes list"""
    
    files = []
    args = (files, filetypes)
    os.path.walk(root, visit, args)
    return files   

if __name__ == '__main__':
    sfprjintro()


-------------- next part --------------

head = r"""
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">


http://docutils.sourceforge.net/" />
 modules in $rootpath, generated at $modifiedtime




INTRODUCTIONS TO THE MODULES

Time:$modifiedtime
Tool:generated by sfprjintro.py
Sum:found $foundnum readmes from total $totalnum packages
Dir :$rootpath
""" briefreadme = r""" """ nobriefreadme = r""" """ wholereadme = r"""
[$itemid]======= $prjname readme======:
$content
""" tail = r"""
"""

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

2005年08月30日 星期二 16:20

Geoffery>>>嘎瑞>>>XuLi geofferyli at gmail.com
Tue Aug 30 16:20:33 HKT 2005

可以介绍的详细点吗?
我正好要读代码学习呢!
谢谢了

在05-8-30,slowness_chen <chenzh at bhh.com.cn> 写道:
> 
> 为了察看从sf上下载的源代码包readme写的一个小脚本
> 用法:python sfprjintro.pt <http://sfprjintro.pt> rootpath
> 察看在rootpath下生成的__readme__.html即可
> 
> _______________________________________________
> python-chinese list
> python-chinese at lists.python.cn
> http://python.cn/mailman/listinfo/python-chinese
> 
> 
> 
> 


-- 
我就是我,是人间不一样的焰火.
升级中..................................
http://groups-beta.google.com/group/moview 电影爱好者讨论组
http://groups-beta.google.com/group/wiki4u wiki爱好者讨论组
http://www.coldtea.cn/blog/blog.asp?name=geoffery 我的博客
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20050830/34908f3c/attachment.htm

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

2005年08月30日 星期二 16:25

limodou limodou at gmail.com
Tue Aug 30 16:25:14 HKT 2005

在 05-8-30,Geoffery>>>嘎瑞>>>XuLi<geofferyli at gmail.com> 写道:
> 可以介绍的详细点吗?
>  我正好要读代码学习呢!
>  谢谢了


建议你先自已看,有不明白的地方再问,而不是一上来就直接让别人给你讲。因为别人也不知道你目前的水平,讲到什么程度算好。

-- 
I like python! 
My Donews Blog: http://www.donews.net/limodou

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

2005年08月30日 星期二 16:30

slowness_chen chenzh at bhh.com.cn
Tue Aug 30 16:30:35 HKT 2005

基本思路是递归查找根目录下的包(现在是zip或 tar.gz),把里面的readme信息读出
来,然后把工程名,简介(从readme信息开始截取一定行)写入html,完全的信息以脚
注的形式写在html末尾

  ----- Original Message -----
  From: Geoffery>>>嘎瑞>>>XuLi
  To: python-chinese at lists.python.cn
  Sent: Tuesday, August 30, 2005 4:20 PM
  Subject: Re: [python-chinese] 一个察看源代码包readme的脚本


  可以介绍的详细点吗?
  我正好要读代码学习呢!
  谢谢了


  在05-8-30,slowness_chen <chenzh at bhh.com.cn> 写道:
    为了察看从sf上下载的源代码包readme写的一个小脚本
    用法:python sfprjintro.pt rootpath
    察看在rootpath下生成的__readme__.html即可

    _______________________________________________
    python-chinese list
    python-chinese at lists.python.cn
    http://python.cn/mailman/listinfo/python-chinese







  --
  我就是我,是人间不一样的焰火.
  升级中..................................
  http://groups-beta.google.com/group/moview 电影爱好者讨论组
  http://groups-beta.google.com/group/wiki4u    wiki爱好者讨论组
  http://www.coldtea.cn/blog/blog.asp?name=geoffery   我的博客




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


  _______________________________________________
  python-chinese list
  python-chinese at lists.python.cn
  http://python.cn/mailman/listinfo/python-chinese
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20050830/32035634/attachment.htm

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

2005年08月30日 星期二 16:31

Geoffery>>>嘎瑞>>>XuLi geofferyli at gmail.com
Tue Aug 30 16:31:35 HKT 2005

这个我知道,我只是发现他的代码没有一点注释,所以读来有点麻烦。
不过还是谢谢limodou大哥的教诲。

在05-8-30,limodou <limodou at gmail.com> 写道:
> 
> 在 05-8-30,Geoffery>>>嘎瑞>>>XuLi<geofferyli at gmail.com> 写道:
> > 可以介绍的详细点吗?
> > 我正好要读代码学习呢!
> > 谢谢了
> 
> 
> 建议你先自已看,有不明白的地方再问,而不是一上来就直接让别人给你讲。因为别人也不知道你目前的水平,讲到什么程度算好。
> 
> --
> I like python!
> My Donews Blog: http://www.donews.net/limodou
> 
> _______________________________________________
> python-chinese list
> python-chinese at lists.python.cn
> http://python.cn/mailman/listinfo/python-chinese
> 
> 
> 


-- 
我就是我,是人间不一样的焰火.
升级中..................................
http://groups-beta.google.com/group/moview 电影爱好者讨论组
http://groups-beta.google.com/group/wiki4u wiki爱好者讨论组
http://www.coldtea.cn/blog/blog.asp?name=geoffery 我的博客
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20050830/7680d390/attachment.html

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

2005年08月30日 星期二 16:38

slowness_chen chenzh at bhh.com.cn
Tue Aug 30 16:38:59 HKT 2005

没有一点注释?
  ----- Original Message -----
  From: Geoffery>>>嘎瑞>>>XuLi
  To: python-chinese at lists.python.cn
  Sent: Tuesday, August 30, 2005 4:31 PM
  Subject: Re: [python-chinese] 一个察看源代码包readme的脚本


  这个我知道,我只是发现他的代码没有一点注释,所以读来有点麻烦。
  不过还是谢谢limodou大哥的教诲。


  在05-8-30,limodou < limodou at gmail.com> 写道:
    在 05-8-30,Geoffery>>>嘎瑞>>>XuLi< geofferyli at gmail.com> 写道:
    > 可以介绍的详细点吗?
    >  我正好要读代码学习呢!
    >  谢谢了


    建议你先自已看,有不明白的地方再问,而不是一上来就直接让别人给你讲。因为
别人也不知道你目前的水平,讲到什么程度算好。

    --
    I like python!
    My Donews Blog: http://www.donews.net/limodou

    _______________________________________________
    python-chinese list
    python-chinese at lists.python.cn
    http://python.cn/mailman/listinfo/python-chinese






  --
  我就是我,是人间不一样的焰火.
  升级中..................................
  http://groups-beta.google.com/group/moview 电影爱好者讨论组
  http://groups-beta.google.com/group/wiki4u   wiki爱好者讨论组
  http://www.coldtea.cn/blog/blog.asp?name=geoffery    我的博客




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


  _______________________________________________
  python-chinese list
  python-chinese at lists.python.cn
  http://python.cn/mailman/listinfo/python-chinese
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20050830/2e519a14/attachment.html

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

2005年08月30日 星期二 16:46

Geoffery>>>嘎瑞>>>XuLi geofferyli at gmail.com
Tue Aug 30 16:46:31 HKT 2005

好,谢谢你。如有问题,我再请教!

在05-8-30,slowness_chen <chenzh at bhh.com.cn> 写道:
> 
> 基本思路是递归查找根目录下的包(现在是zip或 tar.gz
> ),把里面的readme信息读出来,然后把工程名,简介(从readme信息开始截取一定行)写入html,完全的信息以脚注的形式写在html末尾
> 
> ----- Original Message ----- 
> *From:* Geoffery>>>嘎瑞>>>XuLi <geofferyli at gmail.com> 
> *To:* python-chinese at lists.python.cn 
> *Sent:* Tuesday, August 30, 2005 4:20 PM
> *Subject:* Re: [python-chinese] 一个察看源代码包readme的脚本
> 
> 可以介绍的详细点吗?
> 我正好要读代码学习呢!
> 谢谢了
> 
> 在05-8-30,slowness_chen <chenzh at bhh.com.cn> 写道: 
> > 
> > 为了察看从sf上下载的源代码包readme写的一个小脚本
> > 用法:python sfprjintro.pt <http://sfprjintro.pt> rootpath
> > 察看在rootpath下生成的__readme__.html即可
> > 
> > _______________________________________________
> > python-chinese list
> > python-chinese at lists.python.cn
> > http://python.cn/mailman/listinfo/python-chinese
> > 
> > 
> > 
> > 
> 
> 
> -- 
> 我就是我,是人间不一样的焰火.
> 升级中..................................
> http://groups-beta.google.com/group/moview 电影爱好者讨论组
> http://groups-beta.google.com/group/wiki4u wiki爱好者讨论组
> http://www.coldtea.cn/blog/blog.asp?name=geoffery 我的博客
> 
>  ------------------------------
> 
> _______________________________________________
> python-chinese list
> python-chinese at lists.python.cn
> http://python.cn/mailman/listinfo/python-chinese
> 
> 
> _______________________________________________
> python-chinese list
> python-chinese at lists.python.cn
> http://python.cn/mailman/listinfo/python-chinese
> 
> 
> 


-- 
我就是我,是人间不一样的焰火.
升级中..................................
http://groups-beta.google.com/group/moview 电影爱好者讨论组
http://groups-beta.google.com/group/wiki4u wiki爱好者讨论组
http://www.coldtea.cn/blog/blog.asp?name=geoffery 我的博客
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20050830/aa2d0d49/attachment.htm

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

2005年08月30日 星期二 17:00

Geoffery>>>嘎瑞>>>XuLi geofferyli at gmail.com
Tue Aug 30 17:00:08 HKT 2005

sorry,I made a mistake!
我刚才打开的编辑器没有高亮显示,所以没细看。
不过,我也只是想知道这个代码的功能,第一封邮件我没看明白。

在05-8-30,Geoffery>>>嘎瑞>>>XuLi <geofferyli at gmail.com> 写道:
> 
> 好,谢谢你。如有问题,我再请教!
> 
> 在05-8-30,slowness_chen <chenzh at bhh.com.cn> 写道:
> > 
> > 基本思路是递归查找根目录下的包(现在是zip或 tar.gz
> > ),把里面的readme信息读出来,然后把工程名,简介(从readme信息开始截取一定行)写入html,完全的信息以脚注的形式写在html末尾
> > 
> > ----- Original Message ----- 
> >  *From:* Geoffery>>>嘎瑞>>>XuLi <geofferyli at gmail.com> 
> > *To:* python-chinese at lists.python.cn 
> > *Sent:* Tuesday, August 30, 2005 4:20 PM
> > *Subject:* Re: [python-chinese] 一个察看源代码包readme的脚本
> > 
> > 可以介绍的详细点吗?
> > 我正好要读代码学习呢!
> > 谢谢了
> > 
> > 在05-8-30,slowness_chen <chenzh at bhh.com.cn> 写道: 
> > > 
> > > 为了察看从sf上下载的源代码包readme写的一个小脚本
> > > 用法:python sfprjintro.pt <http://sfprjintro.pt> rootpath
> > > 察看在rootpath下生成的__readme__.html即可
> > > 
> > > _______________________________________________
> > > python-chinese list
> > > python-chinese at lists.python.cn
> > > http://python.cn/mailman/listinfo/python-chinese
> > > 
> > > 
> > > 
> > > 
> > 
> > 
> > -- 
> > 我就是我,是人间不一样的焰火.
> > 升级中..................................
> > http://groups-beta.google.com/group/moview 电影爱好者讨论组
> > http://groups-beta.google.com/group/wiki4u wiki爱好者讨论组
> > http://www.coldtea.cn/blog/blog.asp?name=geoffery 我的博客
> > 
> >  ------------------------------
> > 
> > _______________________________________________
> > python-chinese list
> > python-chinese at lists.python.cn
> > http://python.cn/mailman/listinfo/python-chinese
> > 
> > 
> > _______________________________________________
> > python-chinese list
> > python-chinese at lists.python.cn
> > http://python.cn/mailman/listinfo/python-chinese
> > 
> > 
> > 
> 
> 
> -- 
> 我就是我,是人间不一样的焰火.
> 升级中..................................
> http://groups-beta.google.com/group/moview 电影爱好者讨论组
> http://groups-beta.google.com/group/wiki4u wiki爱好者讨论组
> http://www.coldtea.cn/blog/blog.asp?name=geoffery 我的博客
> 
> 


-- 
我就是我,是人间不一样的焰火.
升级中..................................
http://groups-beta.google.com/group/moview 电影爱好者讨论组
http://groups-beta.google.com/group/wiki4u wiki爱好者讨论组
http://www.coldtea.cn/blog/blog.asp?name=geoffery 我的博客
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20050830/a27bc804/attachment.html

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

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

    你的回复:

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

    Zeuux © 2025

    京ICP备05028076号