2007年05月03日 星期四 15:12
ÏÖÔÚµÄÐèÇóÊÇÕâÑùµÄ£¬±ÈÈçÎÒÒªÂÞÁÐÒ»ÏÂÎåλµÄÓÉÊý×ÖºÍÓ¢ÎÄ×Öĸ×é³ÉµÄ×Ö·û´®µÄËùÓÐ×éºÏ£¬ÓÐʲô¼ò±ãµãµÄ·½·¨Ã´£¿ ÏëÁËһϣ¬Ã»Ê²Ã´Í·Ð÷ -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070503/d59a050e/attachment.html
2007年05月03日 星期四 18:00
五重循环不就行了吗? On 5/3/07, Lee DYER <lee.dyer在gmail.com> wrote: > 现在的需求是这样的,比如我要罗列一下五位的由数字和英文字母组成的字符串的所有组合,有什么简便点的方法么? > > 想了一下,没什么头绪 > _______________________________________________ > 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 > -- 蔡峰 Cai Feng
2007年05月03日 星期四 18:00
最直接的算法不就是循环么。这都没头绪,拜托,编程这碗饭不适合你的。 在07-5-3,Lee DYER <lee.dyer在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 > -------------- 下一部分 -------------- 一个HTML附件被移除... URL: http://python.cn/pipermail/python-chinese/attachments/20070503/15b6c955/attachment.htm
2007年05月03日 星期四 18:22
不用这么说吧..... 谁还不是一步步过来的? On 5/3/07, Hope <lanyig在gmail.com> wrote: > 最直接的算法不就是循环么。这都没头绪,拜托,编程这碗饭不适合你的。 > > > 在07-5-3,Lee DYER <lee.dyer在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 > > > > > _______________________________________________ > 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 > -- 蔡峰 Cai Feng
2007年05月03日 星期四 21:48
ÎåÖØÑ»·ÎÒµ±È»ÖªµÀ£¬µ«ÊÇÎÒÕâ¸ö5²¢²»Êǹ̶¨µÄ ¿ÉÄÜλÊý»áºÜ¶à Ö»ÊÇÏëÖªµÀÓÐʲô¼ò±ãµÄ·½·¨Ã» ÔÚ07-5-3£¬ljpsfree <caifen1985在gmail.com> дµÀ£º > > ÎåÖØÑ»·²»¾ÍÐÐÁËÂ𣿠> > > On 5/3/07, Lee DYER <lee.dyer在gmail.com> wrote: > > ÏÖÔÚµÄÐèÇóÊÇÕâÑùµÄ£¬±ÈÈçÎÒÒªÂÞÁÐÒ»ÏÂÎåλµÄÓÉÊý×ÖºÍÓ¢ÎÄ×Öĸ×é³ÉµÄ×Ö·û´®µÄËùÓÐ×éºÏ£¬ÓÐʲô¼ò±ãµãµÄ·½·¨Ã´£¿ > > > > ÏëÁËһϣ¬Ã»Ê²Ã´Í·Ð÷ > > _______________________________________________ > > 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 > > > > > -- > ²Ì·å Cai Feng > _______________________________________________ > 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 -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070503/8e279ae0/attachment.htm
2007年05月03日 星期四 21:56
¼¼ÊõºÍ°ÁÂý³Ì¶ÈÍùÍù³É·´±ÈµÄ ±ÈÈçLimodou δû¼ûµ½¹ýËû˵£ºÁ¬Õâ¸öÄã¶¼²»»á£¿»Ø¼ÒÖֵذɡ£ On 5/3/07, Hope <lanyig在gmail.com> wrote: > ×îÖ±½ÓµÄËã·¨²»¾ÍÊÇÑ»·Ã´¡£ÕⶼûͷÐ÷£¬°ÝÍУ¬±à³ÌÕâÍë·¹²»ÊʺÏÄãµÄ¡£ -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070503/ff8b093d/attachment.html
2007年05月03日 星期四 22:28
你要所有的组合,我觉得没有什么捷径。不如把你的具体应用说一下。 On 5/3/07, Lee DYER <lee.dyer在gmail.com> wrote: > 五重循环我当然知道,但是我这个5并不是固定的 > > 可能位数会很多 > > 只是想知道有什么简便的方法没 > > > 在07-5-3,ljpsfree <caifen1985在gmail.com> 写道: > > 五重循环不就行了吗? > > > > > > On 5/3/07, Lee DYER <lee.dyer在gmail.com> wrote: > > > 现在的需求是这样的,比如我要罗列一下五位的由数字和英文字母组成的字符串的所有组合,有什么简便点的方法么? > > > > > > 想了一下,没什么头绪 > > > _______________________________________________ > > > 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 > > > > > > > > > -- > > 蔡峰 Cai Feng > > _______________________________________________ > > 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 >
2007年05月04日 星期五 00:20
On 5/3/07, Lee DYER <lee.dyer在gmail.com> wrote: > 现在的需求是这样的,比如我要罗列一下五位的由数字和英文字母组成的字符串的所有组合,有什么简便点的方法么? > > 想了一下,没什么头绪 像这种每重循环做的事差不多,但有多少重不一定的情况,用递归是最方便的: #coding:utf-8 sample = "01" # 样本空间 def permutation(level, s): if level == 0: print s return for letter in sample: # 从样本中取一个 permutation(level-1, s+letter) def main(): permutation(5, "") # 打印5位的排列 main() -- Best Regards, Leo Jay
2007年05月04日 星期五 00:21
http://bbs.chinaunix.net/viewthread.php?tid=920920&extra;=page%3D4 On 5/3/07, Yang Yongsheng <ysyang2002在gmail.com> wrote: > 你要所有的组合,我觉得没有什么捷径。不如把你的具体应用说一下。 > > On 5/3/07, Lee DYER <lee.dyer在gmail.com> wrote: > > 五重循环我当然知道,但是我这个5并不是固定的 > > > > 可能位数会很多 > > > > 只是想知道有什么简便的方法没 > > > > > > 在07-5-3,ljpsfree <caifen1985在gmail.com> 写道: > > > 五重循环不就行了吗? > > > > > > > > > On 5/3/07, Lee DYER <lee.dyer在gmail.com> wrote: > > > > 现在的需求是这样的,比如我要罗列一下五位的由数字和英文字母组成的字符串的所有组合,有什么简便点的方法么? > > > > > > > > 想了一下,没什么头绪 > > > > _______________________________________________ > > > > 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 > > > > > > > > > > > > > -- > > > 蔡峰 Cai Feng > > > _______________________________________________ > > > 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 > > > _______________________________________________ > 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
2007年05月04日 星期五 00:27
On 5/4/07, shhgs <shhgs.efhilt在gmail.com> wrote: > http://bbs.chinaunix.net/viewthread.php?tid=920920&extra;=page%3D4 > 你的是不重复的吧?可是,楼主好像没说一定要不重复啊? -- Best Regards, Leo Jay
2007年05月04日 星期五 00:40
不用太敏感了。如果有人告诉我,我的职业生涯更适合做什麽,我会很感谢他的。不管他的语气,出发点,只要有道理。 我相信任何工作都需要敏感度或者说嗅觉。这个实现,从楼主简单的诉说中,第一印象就是循环,其次才会考虑到优化,一般性,算法改进。如果这个第一印象都没有。我的提议有问题吗? 在07-5-3,风向标 <vaneoooo在gmail.com> 写道: > > 技术和傲慢程度往往成反比的 > > 比如Limodou > 未没见到过他说:连这个你都不会?回家种地吧。 > > > On 5/3/07, Hope <lanyig在gmail.com> wrote: > > 最直接的算法不就是循环么。这都没头绪,拜托,编程这碗饭不适合你的。 > > > _______________________________________________ > 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 > -------------- 下一部分 -------------- 一个HTML附件被移除... URL: http://python.cn/pipermail/python-chinese/attachments/20070504/2d6cf0cb/attachment-0001.html
2007年05月04日 星期五 07:36
Çë½Ì´ó¼Ò
ÓÐûÓÐÔÚFreebsd 6.x »·¾³ + Apache 2.2.4 +Mod_fastcgi 2.4.2 µÄdjango´î½¨¾Ñé?
°²×°Íê»ù±¾µÄApache¡¢fastcgi¡¢flup ºÍdjangoºó¡£²»¶®ÈçºÎÅäºÏÔËÐÐÆðÀ´£¬ÒÀdjangoproject.comÍøÕ¾µÄ˵Ã÷£¨
How to use Django with FastCGI, SCGI or AJP£©
ÅäÖã¬ÔËÐеĽá¹ûÊÇÖ±½ÓÏÔʾԴ´úÂëÁË£¡¹À¼ÆÎÒ»¹Ã»ÓÐ×öºÃ¡£ÒÔÏÂÊÇÎÒ´óÖÂÔÚ°²×°ÍêÒÔÉÏ×é¼þµÄ²½Ö裬ÇëÖ¸½Ì£¡
1¡¢ÐÞ¸Ähttpd.conf£¬ÔÚÎļþ×îºó¼ÓÈëÁË:
FastCGIExternalServer /home/user/public_html/mysite.fcgi -host 127.0.0.1:3033
2¡¢ÔÚ/home/www/mysite.comĿ¼ÏÂʹÓÃÃüÁ´´½¨ÏîÄ¿
django-admin.py startproject MyApp
3¡¢ÔÚ/home/www/mysite.com/MyAppĿ¼Ï´´½¨ .htaccess ÅäÖÃÎļþ,ÄÚÈݲο¼:
AddHandler fastcgi-script .fcgi
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ mysite.fcgi/$1 [QSA,L]
4¡¢´´½¨¸ºÔð´¦ÀífcgiµÄÅäÖÃ
#!/usr/bin/python
import sys, os
# Add a custom Python path.
sys.path.insert(0, "/home/www/mysite.com/MyApp")
# Set the DJANGO_SETTINGS_MODULE environment variable.
os.environ['DJANGO_SETTINGS_MODULE'] = "MyApp.settings"
from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")
5¡¢ÖØÆô apache
apachectl restart
Æô¶¯Ã»±¨´í.
½á¹û£º
ͨ¹ýIPä¯ÀÀÄÚÈÝʱ£¬Ö±½ÓÏÔʾĿ¼ºÍÎļþÁÐ±í¡£
ÊäÈëÎļþÃûʱֱ½ÓÏÔʾÄÚÈÝ£¨Ô´Â룩¡£
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20070504/9759a163/attachment-0001.html
2007年05月04日 星期五 12:14
Îʸö¼òµ¥µÄÎÊÌâ, ʹÓà ÕâÑùÅäÖõÄdjangoÓëÆ½Ê±Ê¹ÓõĴúÂëÃ»Çø±ð°É? ΪʲôÎÒ·ÃÎÊ·þÎñÆ÷ʱ¶¼ÊÇ 404 bad request ´íÎóѽ? -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070504/cc1767a1/attachment.html
2007年05月04日 星期五 14:14
单纯就这个编程问题来说,我觉得用递归比较好。 也许应该把问题描述的清楚一点,全排列?不重复组合?生成的组合是否定长? 在07-5-4,Hope <lanyig在gmail.com> 写道: > > 不用太敏感了。如果有人告诉我,我的职业生涯更适合做什麽,我会很感谢他的。不管他的语气,出发点,只要有道理。 > > 我相信任何工作都需要敏感度或者说嗅觉。这个实现,从楼主简单的诉说中,第一印象就是循环,其次才会考虑到优化,一般性,算法改进。如果这个第一印象都没有。我的提议有问题吗? > > > 在07-5-3,风向标 <vaneoooo在gmail.com> 写道: > > > > 技术和傲慢程度往往成反比的 > > > > 比如Limodou > > 未没见到过他说:连这个你都不会?回家种地吧。 > > > > > > On 5/3/07, Hope <lanyig在gmail.com> wrote: > > > 最直接的算法不就是循环么。这都没头绪,拜托,编程这碗饭不适合你的。 > > > > > > _______________________________________________ > > 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 > -------------- 下一部分 -------------- 一个HTML附件被移除... URL: http://python.cn/pipermail/python-chinese/attachments/20070504/654536f1/attachment.html
2007年05月04日 星期五 14:22
一个HTML附件被移除... URL: http://python.cn/pipermail/python-chinese/attachments/20070504/0bc74aae/attachment.html
2007年05月04日 星期五 16:27
·çÏò±ê˵µÄ»°ÎÒºÜÈÏͬ£¡
ÎÒ±¾ÈË×îÌÖÑáÄÇÖÖ°ÁÂýµÄÈË¡£È˼ÒÎÊÎÊÌ⣬"°ÁÂý"µÄÈËÄã¾õµÃ³öÊÖ"ÀË·Ñ"ÄãµÄ"±¦¹ó"ʱ¼äµÄ»°£¬Äã¿ÉÒÔ²»»Ø´ð£¡ÈúÃÐÄÒ»µãµÄÈ˻شð¡£ÄãºÎ±ØËµÐ©ÄÇôÉ˺¦ÈËÐĵϰ¡£
ѧ±à³Ì£¬²»Ò»¶¨ÊǼÆËã»úרҵµÄÈ˲ÅѧµÄ£¬È˼ҿÉÒÔÒÔ°®ºÃµÄ·½Ê½Ñ§Ï°µÄÂï¡£ÎҾͲ»ÊǼÆËã»úµÄ¡£µ«ÊÇÎÒ¾ÍÊÇϲ»¶±à³Ìѽ£¬²¢ÇҺܲ
ÏÂÃæÊÇÎÒÎÊÎÊÌâlimodouµÄƬ¶Î£¬È˼ÒlimodouÕæµÄûÓÐÒòΪÎҵļòµ¥ÎÊÌâ˵Щ"°ÁÂý"µÄ»°£º
4:36 PM
me: ÓпÕÂð?
limodou: ʲôÊ£¿
4:37 PM me: ÎÒдÁËÒ»¸ödjangoµÄÄ£°å,ÏëÖªµÀÄ£°åÓÐûÓгö´í,ÊDz»ÊÇÖ±½ÓÓÃdjango.templateÀïµÄ·½·¨¾ÍÐÐÁË?
»¹Òª½¨ÏîÄ¿Âð?
ÊÇhtmlÄ£°å
4:38 PM limodou: Ò»°ã¶¼ÒªÔÚÒ»¸öÏîĿϲâÊÔ
4:39 PM me: Ŷ .ÎÒûÓÐÏîĿʱ,³ö´íÁË.˵ûÓÐSETTING±äÁ¿
limodou: Êǵģ¬Ðí¶àdjangoµÄÄ£¿é£¬Ã»ÓÐÏîÄ¿ÊÇÅܲ»ÆðÀ´µÄ
ÄãµÄÏîÄ¿¿ÉÒԷdz£¼òµ¥
4:40 PM me: ok,лл»Ø´ð
4:41 PM {% for topicMember,secondArg in topicsData,other %}ÕâÑùûÓдí°É?
4:42 PM limodou: ûÕâÑùµÄÓï·¨
4:44 PM me: ÊÇŶ.лл
¸ßÊÖ¶àµÄÊÇ£¬Äã²»»Ø´ð¾ÍËãÁË¡£ËµÒ»Ð©"ÉËÈË"µÄ»°¡£ÎÒ±ÉÊÓÄ㣡
On 5/3/07, ·çÏò±ê <vaneoooo在gmail.com> wrote:
>
> ¼¼ÊõºÍ°ÁÂý³Ì¶ÈÍùÍù³É·´±ÈµÄ
>
> ±ÈÈçLimodou
> δû¼ûµ½¹ýËû˵£ºÁ¬Õâ¸öÄã¶¼²»»á£¿»Ø¼ÒÖֵذɡ£
>
>
> On 5/3/07, Hope <lanyig在gmail.com> wrote:
> > ×îÖ±½ÓµÄËã·¨²»¾ÍÊÇÑ»·Ã´¡£ÕⶼûͷÐ÷£¬°ÝÍУ¬±à³ÌÕâÍë·¹²»ÊʺÏÄãµÄ¡£
>
>
> _______________________________________________
> 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
>
--
×¢ÒâÉíÌ壬ÉíÌåÊǸïÃüµÄ±¾Ç®£¡£¡
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20070504/2f2c6478/attachment.htm
2007年05月04日 星期五 21:00
On Thu, May 03, 2007 at 03:12:21PM +0800, Lee DYER wrote:
> 现在的需求是这样的,比如我要罗列一下五位的由数字和英文字母组成的字符串的所有组
> 合,有什么简便点的方法么?
>
> 想了一下,没什么头绪
>
def permute(seq):
seqn = [ seq.pop()+seq.pop() ]
while seq:
newseq = []
new = seq.pop()
#print "seq:",seq,'seqn', seqn ,'new', new
for i in range(len(seqn)):
item = seqn[i]
for j in range(len(item)+1):
newseq.append(''.join([item[:j],new,item[j:]]))
seqn = newseq
#print 'newseq',newseq
return seqn
import sys, calc
seq = list(sys.argv[1])
where = int(sys.argv[2])
thelist = permute(seq)
print 'Got', len(thelist), 'items.'
print thelist
2007年05月06日 星期日 11:46
On 5/4/07, bbenyu <bbenyu在gmail.com> wrote: > > 问个简单的问题, 使用 这样配置的django与平时使用的代码没区别吧? > > 为什么我访问服务器时都是 404 bad request 错误呀? 我的体会是除了把settings.py中的路径都改为绝对路径,然后是处理好静态url和链接映射的处理,基本上就没有什么事情了。 -- I like python! UliPad <>: http://wiki.woodpecker.org.cn/moin/UliPad My Blog: http://www.donews.net/limodou
2007年05月09日 星期三 10:02
Lee DYER wrote:
> 现在的需求是这样的,比如我要罗列一下五位的由数字和英文字母组成的字符串
> 的所有组合,有什么简便点的方法么?
> 想了一下,没什么头绪
参见Cookbook: Recipe 19.15. Generating Permutations, Combinations, and
Selections
print "Selections of 2 letters from 'bar'"
print map(''.join, selections('bar', 2))
# emits ['bb', 'ba', 'br', 'ab', 'aa', 'ar', 'rb', 'ra', 'rr']
2007年05月09日 星期三 11:29
# 得到全排列
def permute(seq):
seqn = [ seq.pop() ]
while seq:
newseq = []
new = seq.pop()
#print "seq:",seq,'seqn', seqn ,'new', new
for i in range(len(seqn)):
item = seqn[i]
for j in range(len(item)+1):
newseq.append(''.join([item[:j],new,item[j:]]))
seqn = newseq
#print 'newseq',newseq
return seqn
在 07-5-9,jinq0123在163.com<jinq0123在163.com> 写道:
> Lee DYER wrote:
> > 现在的需求是这样的,比如我要罗列一下五位的由数字和英文字母组成的字符串
> > 的所有组合,有什么简便点的方法么?
> > 想了一下,没什么头绪
> 参见Cookbook: Recipe 19.15. Generating Permutations, Combinations, and
> Selections
>
> print "Selections of 2 letters from 'bar'"
> print map(''.join, selections('bar', 2))
> # emits ['bb', 'ba', 'br', 'ab', 'aa', 'ar', 'rb', 'ra', 'rr']
>
>
>
>
>
> _______________________________________________
> 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
2007年05月09日 星期三 14:07
×î½üÔÚÓÃdjango×ö¸öÉ̳Ç,ÔÒÔΪģ°å¿ÉÒÔ½øÐÐÂß¼ËãÊõ¼ÆËã.¿ÉÊǺÃÏñÐв»Í¨ÁË! ÓиöСÎÊÌâ,ĿǰÎÒÖ»ÄÜͨ¹ýviewsÀï¼ÆËãÈ»ºó·µ»ØÕûºÃµÄ×Ö·û´®,µ«ÕâÑù²»Ì«·½±ã. ÎÒÏë¿ÉÒÔͨ¹ý×Ô¶¨ÒåtagÀ´ÊµÏÖ,ÕâÊÇÒ»¸ö·½·¨,²»ÏþµÃ´ó¼ÒÓÐʲôºÃµÄ½¨Òé»ò·½·¨? -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070509/6b8a747c/attachment.htm
Zeuux © 2025
京ICP备05028076号