2007年07月05日 星期四 11:45
a = '111,333' tuple(a.split(',')) µÃµ½. ('111', '333') µ«ÎÒÏëÒªintµÄ. (111, 333) Homepage: http://www.netkiller.org.cn Python + Django http://album.bg7nyt.cn -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070705/5594e07a/attachment.htm -------------- 下一部分 -------------- Ò»¸ö·ÇÎı¾¸½¼þ±»Çå³ý... ·¢ÐÅÈË: %(who)s Ö÷Ìâ: %(subject)s ÈÕÆÚ: %(date)s ´óС: 1325 Url: http://python.cn/pipermail/python-chinese/attachments/20070705/5594e07a/attachment-0001.bin
2007年07月05日 星期四 11:49
a = '111,333' tuple(map(int, a.split(','))) ÔÚ07-7-5£¬Neo Chen <openunix在163.com> дµÀ£º > > a = '111,333' > tuple(a.split(',')) > > µÃµ½. > > ('111', '333') > > µ«ÎÒÏëÒªintµÄ. > (111, 333) > > Homepage: http://www.netkiller.org.cn > Python + Django http://album.bg7nyt.cn > > _______________________________________________ > 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/20070705/d2c68ab7/attachment.htm
2007年07月05日 星期四 11:55
tuple( [int(n) for n in a.split(',')]) On 7/5/07, Neo Chen <openunix在163.com> wrote: > > > a = '111,333' > > tuple(a.split(',')) > > 得到. > > ('111', '333') > > 但我想要int的. > (111, 333) > > Homepage: http://www.netkiller.org.cn > Python + Django http://album.bg7nyt.cn > _______________________________________________ > 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年07月05日 星期四 11:55
·Ç³£¸Ðл. ----- Original Message ----- From: lai yonghao To: python-chinese在lists.python.cn Sent: Thursday, July 05, 2007 11:49 AM Subject: Re: [python-chinese] (ÎÞÖ÷Ìâ) a = '111,333' tuple(map(int, a.split(','))) ÔÚ07-7-5£¬Neo Chen <openunix在163.com> дµÀ£º a = '111,333' tuple(a.split(',')) µÃµ½. ('111', '333') µ«ÎÒÏëÒªintµÄ. (111, 333) Homepage: http://www.netkiller.org.cn Python + Django http://album.bg7nyt.cn _______________________________________________ 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/20070705/e0e13c1f/attachment.html
2007年07月05日 星期四 12:46
http://www.builderau.com.au/program/python/soa/Data_driven_transformations_list_comprehensions/0,2000064084,339279491,00.htm ½²½âÁËÕâÁ½ÖÖÓ÷¨. On 7/5/07, Neo Chen <openunix在163.com> wrote: > > ·Ç³£¸Ðл. > -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070705/3d8c5870/attachment.html
2007年07月05日 星期四 13:01
ÌâÍâ»°£º tuple( [int(n) for n in a.split(',')]) ÀïµÄÁ½¸ö[]²»ÊDZØÒªµÄ£¬Èç¹ûÈ¥µô£¬¿ÉÒԵóöÒ»ÑùµÄ½á¹û£¨Py 2.4»òÒÔÉÏÖ§³Ö£©¡£ Õâ¿ÉÒÔÓÅ»¯ÐÔÄÜ£¬ÒòΪÎÞÐèÉú³ÉÒ»¸öÕæÕýµÄlist¡£ Èç¹ûÄã¾õµÃ¿É¶ÁÐÔÓÐËùϽµ»òÕß²»·ûºÏÄãµÄÏ°¹ß£¬¿ÉÒÔʹÓ㺠( int(n) for n in a.split(',')) ·½°¸£¬Py 2.5Ö§³Ö£¬µ«×¢ÒâÁË£¬ÕâÖ»ÊÇÒ»¸öÉú³ÉÆ÷¡£ 2007/7/5, Wei Jiang <jiejisheng在gmail.com>: > > tuple( [int(n) for n in a.split(',')]) > > On 7/5/07, Neo Chen <openunix在163.com> wrote: > > > > > > a = '111,333' > > > > tuple(a.split(',')) > > > > µÃµ½. > > > > ('111', '333') > > > > µ«ÎÒÏëÒªintµÄ. > > (111, 333) > > > > Homepage: http://www.netkiller.org.cn > > Python + Django http://album.bg7nyt.cn > > _______________________________________________ > > 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/20070705/a1bb0ae4/attachment.html
Zeuux © 2025
京ICP备05028076号