2007年06月25日 星期一 17:13
"9/5" ×Ö·û´®. ÎÒÏë¼ÆËã 9/5 = 1.8 ?? -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070625/48d4434a/attachment.html -------------- 下一部分 -------------- Ò»¸ö·ÇÎı¾¸½¼þ±»Çå³ý... ·¢ÐÅÈË: %(who)s Ö÷Ìâ: %(subject)s ÈÕÆÚ: %(date)s ´óС: 1325 Url: http://python.cn/pipermail/python-chinese/attachments/20070625/48d4434a/attachment.bin
2007年06月25日 星期一 17:16
eval °É On 6/25/07, Neo Chen <openunix在163.com> wrote: > > "9/5" ×Ö·û´®. > > ÎÒÏë¼ÆËã 9/5 = 1.8 ?? > > _______________________________________________ > 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/20070625/a9c95170/attachment.htm
2007年06月25日 星期一 17:18
i = eval('9.0/5.0')
print i
1.8
ÔÚ07-6-25£¬Neo Chen <openunix在163.com> дµÀ£º
>
> "9/5" ×Ö·û´®.
>
> ÎÒÏë¼ÆËã 9/5 = 1.8 ??
>
> _______________________________________________
> 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/20070625/275264c3/attachment.htm
2007年06月25日 星期一 17:20
Ö±½ÓevalµÃ1£¬µÃ²»³ö1.8
>>> eval('9.0/5')
1.8
-----Original Message-----
From: python-chinese-bounces在lists.python.cn [mailto:python-chinese-bounces在lists.python.cn]On Behalf Of Tian
Sent: Monday, June 25, 2007 5:17 PM
To: python-chinese在lists.python.cn
Subject: Re: [python-chinese] ×Ö·û´®,µ±ÕûÐÍÀ´´¦Àí??
eval °É
On 6/25/07, Neo Chen < openunix在163.com> wrote:
"9/5" ×Ö·û´®.
ÎÒÏë¼ÆËã 9/5 = 1.8 ??
_______________________________________________
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/20070625/64ff59cd/attachment.htm
2007年06月25日 星期一 17:20
½á¹û²»¶Ô?
>>> int(eval('9/5'))
1
>>> float(eval('9/5'))
1.0
----- Original Message -----
From: Tian
To: python-chinese在lists.python.cn
Sent: Monday, June 25, 2007 5:16 PM
Subject: Re: [python-chinese] ×Ö·û´®,µ±ÕûÐÍÀ´´¦Àí??
eval °É
On 6/25/07, Neo Chen <openunix在163.com> wrote:
"9/5" ×Ö·û´®.
ÎÒÏë¼ÆËã 9/5 = 1.8 ??
_______________________________________________
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/20070625/8ef0fa13/attachment-0001.html
2007年06月25日 星期一 18:21
ÕâÑùÎÒ»¹µÃ×öÒ»´Î×Ö·û´®´úÌæ? :( ----- Original Message ----- From: Liming_Do To: python-chinese在lists.python.cn Sent: Monday, June 25, 2007 5:20 PM Subject: Re: [python-chinese] ×Ö·û´®,µ±ÕûÐÍÀ´´¦Àí?? Ö±½ÓevalµÃ1£¬µÃ²»³ö1.8 >>> eval('9.0/5') 1.8 -----Original Message----- From: python-chinese-bounces在lists.python.cn [mailto:python-chinese-bounces在lists.python.cn]On Behalf Of Tian Sent: Monday, June 25, 2007 5:17 PM To: python-chinese在lists.python.cn Subject: Re: [python-chinese] ×Ö·û´®,µ±ÕûÐÍÀ´´¦Àí?? eval °É On 6/25/07, Neo Chen <openunix在163.com> wrote: "9/5" ×Ö·û´®. ÎÒÏë¼ÆËã 9/5 = 1.8 ?? _______________________________________________ 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/20070625/c0d4e318/attachment.html
2007年06月25日 星期一 18:49
On 6/25/07, Neo Chen <openunix在163.com> wrote: > > > "9/5" 字符串. > > 我想计算 9/5 = 1.8 ?? 在python里,9/5的结果就是1,所以你不可能直接由eval得到1.8的结果。 要么你就自己写解析的程序。 -- Best Regards, Leo Jay
2007年06月25日 星期一 19:02
On 6/25/07, Leo Jay <python.leojay在gmail.com> wrote: > On 6/25/07, Neo Chen <openunix在163.com> wrote: > > "9/5" 字符串. > > 我想计算 9/5 = 1.8 ?? > > 在python里,9/5的结果就是1,所以你不可能直接由eval得到1.8的结果。 > 要么你就自己写解析的程序。 看看这个 ;) .>>> from __future__ import division .>>> eval('9/5') 1.8 -- Qiangning Hong http://www.douban.com/people/hongqn/
2007年06月25日 星期一 19:33
赞! On 6/25/07, Leo Jay <python.leojay在gmail.com> wrote: > On 6/25/07, Neo Chen <openunix在163.com> wrote: > > "9/5" 字符串. > > 我想计算 9/5 = 1.8 ?? > > 在python里,9/5的结果就是1,所以你不可能直接由eval得到1.8的结果。 > 要么你就自己写解析的程序。 看看这个 ;) .>>> from __future__ import division .>>> eval('9/5') 1.8
2007年06月25日 星期一 19:37
µ±È»qiangningµÄ·½·¨ÊÇ×îºÃ
Èç¹ûÓÃÍÁ°ì·¨Ò²Óò»×ÅÌæ»»£¬
·´Õý¶¼ÊÇÊý×Ö£¬Ö±½Ó×Ö·û´®Á¬½Ó¾Í¿ÉÒÔ
>>> eval('9/5' + '.0')
1.8
-----Original Message-----
From: python-chinese-bounces在lists.python.cn [mailto:python-chinese-bounces在lists.python.cn]On Behalf Of Neo Chen
Sent: Monday, June 25, 2007 6:22 PM
To: python-chinese在lists.python.cn
Subject: Re: [python-chinese] ×Ö·û´®,µ±ÕûÐÍÀ´´¦Àí??
ÕâÑùÎÒ»¹µÃ×öÒ»´Î×Ö·û´®´úÌæ? :(
----- Original Message -----
From: Liming_Do Liming_Do在smics.com>
To: python-chinese在lists.python.cn
Sent: Monday, June 25, 2007 5:20 PM
Subject: Re: [python-chinese] ×Ö·û´®,µ±ÕûÐÍÀ´´¦Àí??
Ö±½ÓevalµÃ1£¬µÃ²»³ö1.8
>>> eval('9.0/5')
1.8
-----Original Message-----
From: python-chinese-bounces在lists.python.cn [mailto:python-chinese-bounces在lists.python.cn]On Behalf Of Tian
Sent: Monday, June 25, 2007 5:17 PM
To: python-chinese在lists.python.cn
Subject: Re: [python-chinese] ×Ö·û´®,µ±ÕûÐÍÀ´´¦Àí??
eval °É
On 6/25/07, Neo Chen < openunix在163.com> wrote:
"9/5" ×Ö·û´®.
ÎÒÏë¼ÆËã 9/5 = 1.8 ??
_______________________________________________
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/20070625/54656311/attachment.html
2007年06月25日 星期一 19:43
太NB了 在 Mon, 25 Jun 2007 19:33:12 +0800,Liming_Do <Liming_Do在smics.com> 写道: > 赞! > On 6/25/07, Leo Jay <python.leojay在gmail.com> wrote: >> On 6/25/07, Neo Chen <openunix在163.com> wrote: >> > "9/5" 字符串. >> > 我想计算 9/5 = 1.8 ?? >> >> 在python里,9/5的结果就是1,所以你不可能直接由eval得到1.8的结果。 >> 要么你就自己写解析的程序。 > > 看看这个 ;) > > .>>> from __future__ import division > .>>> eval('9/5') > 1.8 > _______________________________________________ > 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 -- Thanks!
2007年06月25日 星期一 19:44
Thanks! 在 Mon, 25 Jun 2007 19:33:12 +0800,Liming_Do <Liming_Do在smics.com> 写道: > 赞! > On 6/25/07, Leo Jay <python.leojay在gmail.com> wrote: >> On 6/25/07, Neo Chen <openunix在163.com> wrote: >> > "9/5" 字符串. >> > 我想计算 9/5 = 1.8 ?? >> >> 在python里,9/5的结果就是1,所以你不可能直接由eval得到1.8的结果。 >> 要么你就自己写解析的程序。 > > 看看这个 ;) > > .>>> from __future__ import division > .>>> eval('9/5') > 1.8 > _______________________________________________ > 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 -- Thanks!
2007年06月25日 星期一 20:29
zan! ÔÚ07-6-25£¬Qiangning Hong <hongqn在gmail.com> дµÀ£º > > On 6/25/07, Leo Jay <python.leojay在gmail.com> wrote: > > On 6/25/07, Neo Chen <openunix在163.com> wrote: > > > "9/5" ×Ö·û´®. > > > ÎÒÏë¼ÆËã 9/5 = 1.8 ?? > > > > ÔÚpythonÀ9/5µÄ½á¹û¾ÍÊÇ1£¬ËùÒÔÄã²»¿ÉÄÜÖ±½ÓÓÉevalµÃµ½1.8µÄ½á¹û¡£ > > ҪôÄã¾Í×Ô¼ºÐ´½âÎöµÄ³ÌÐò¡£ > > ¿´¿´Õâ¸ö ;) > > .>>> from __future__ import division > .>>> eval('9/5') > 1.8 > > -- > Qiangning Hong > http://www.douban.com/people/hongqn/ > _______________________________________________ > 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/20070625/cff6ef0a/attachment.htm
2007年06月26日 星期二 00:55
8错8错 在07-6-25,马宏亮 <mhl1983 at gmail.com> 写道: > > zan! > > 在07-6-25,Qiangning Hong <hongqn at gmail.com> 写道: > > > > On 6/25/07, Leo Jay <python.leojay at gmail.com> wrote: > > > On 6/25/07, Neo Chen <openunix at 163.com> wrote: > > > > "9/5" 字符串. > > > > 我想计算 9/5 = 1.8 ?? > > > > > > 在python里,9/5的结果就是1,所以你不可能直接由eval得到1.8的结果。 > > > 要么你就自己写解析的程序。 > > > > 看看这个 ;) > > > > .>>> from __future__ import division > > .>>> eval('9/5') > > 1.8 > > > > -- > > Qiangning Hong > > http://www.douban.com/people/hongqn/ > > _______________________________________________ > > 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/20070626/04c4ffbd/attachment.html
2007年06月26日 星期二 10:01
非常感谢,这是最佳方案. ----- Original Message ----- From: "Qiangning Hong" <hongqn在gmail.com> To: <python-chinese在lists.python.cn> Sent: Monday, June 25, 2007 7:02 PM Subject: Re: [python-chinese] 字符串,当整型来处理?? > On 6/25/07, Leo Jay <python.leojay在gmail.com> wrote: >> On 6/25/07, Neo Chen <openunix在163.com> wrote: >> > "9/5" 字符串. >> > 我想计算 9/5 = 1.8 ?? >> >> 在python里,9/5的结果就是1,所以你不可能直接由eval得到1.8的结果。 >> 要么你就自己写解析的程序。 > > 看看这个 ;) > > .>>> from __future__ import division > .>>> eval('9/5') > 1.8 > > -- > Qiangning Hong > http://www.douban.com/people/hongqn/ > _______________________________________________ > 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年06月26日 星期二 14:55
Ö±½ÓÓÃfloat()ת»»³É¸¡µãÐ͵ÄÔÙ×÷ÔËËã,Ò²ÐеÄ. ÔÚ07-6-25£¬Neo Chen <openunix在163.com> дµÀ£º > > ÕâÑùÎÒ»¹µÃ×öÒ»´Î×Ö·û´®´úÌæ? :( > > ----- Original Message ----- > *From:* Liming_Do <Liming_Do在smics.com> > *To:* python-chinese在lists.python.cn > *Sent:* Monday, June 25, 2007 5:20 PM > *Subject:* Re: [python-chinese] ×Ö·û´®,µ±ÕûÐÍÀ´´¦Àí?? > > Ö±½ÓevalµÃ1£¬µÃ²»³ö1.8 > >>> eval('9.0/5') > 1.8 > > -----Original Message----- > *From:* python-chinese-bounces在lists.python.cn [mailto: > python-chinese-bounces在lists.python.cn]*On Behalf Of *Tian > *Sent:* Monday, June 25, 2007 5:17 PM > *To:* python-chinese在lists.python.cn > *Subject:* Re: [python-chinese] ×Ö·û´®,µ±ÕûÐÍÀ´´¦Àí?? > > eval °É > > On 6/25/07, Neo Chen <openunix在163.com> wrote: > > > > "9/5" ×Ö·û´®. > > > > ÎÒÏë¼ÆËã 9/5 = 1.8 ?? > > > > _______________________________________________ > > 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 > -- ÈËÉú¾ÍÏñÒ»¸öÆ¿×Ó£¬¶øÉú»î¾ÍÊÇÆ¿×ÓÀïµÄË®¡£ -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070626/e3db7321/attachment.html
Zeuux © 2025
京ICP备05028076号