为何选择“打印”进入“打印()”???? [英] Why Turn "Print" into "Print()"????

查看:74
本文介绍了为何选择“打印”进入“打印()”????的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



你友好的邻居n00b在这里,只是想知道为什么在地球上

Py3K人们想要搞简单的事情,如打印

" command" (这就是所谓的命令吗?),把它变成

" print()" ...我的意思是,重点是什么?看起来更像是传统的bb。计算机语言格式?


不支持所谓的软空间功能是什么?

当前的打印命令,逗号后面的空格,如


Hi, your friendly neighborhood n00b here, just wondering why on earth
the Py3K folks want to mess with a simple thing like the "print"
"command" (is that what it''s called, a command?), turning it into
"print()"...I mean, what''s the point, exactly?? To look like a more
"traditional" computer-language format?

And what''s with not supporting the so-called softspace "feature" of
the current "print" command, where a space after a comma, like


>>> print" ; A \ n,B
>>>print "A\n", "B"



输出

outputs


>>> A\\\
B\\\

>>>A\nB\n



但是使用Py3K它将是

but with Py3K it will be


>>> print(" A\\\
"," B")
>>>print("A\n", "B")



返回

returning


>>> A \ n B \ n
>>>A\n B\n



?? ??


我很高兴开始学习这门语言,突然之间我发现新版本将在夏末/初秋发布

今年 - 新版本不仅不向后兼容

w以前的版本有许多重要方面,但即使它来了一些像打印这样的小东西。命令!!


这是怎么回事?

????

I was all excited to start learning the language, when suddenly I find
out that a new version is slated for release late summer/early fall
this year -- a new version which is not only not backwards-compatible
with previous versions in many important ways, but even when it comes
to a little thing like the "print" command!!

What''s up with that??

推荐答案

5月25日,8日:下午26点,战争中的囚徒< prisoner_at _... @ yahoo.comwrote:
On May 25, 8:26 pm, Prisoner at War <prisoner_at_...@yahoo.comwrote:

你友好的邻居n00b在这里,只是想知道为什么在地球上
Py3K的人们想要搞简单的事情,比如打印

" command" (这就是所谓的命令吗?),把它变成

" print()" ...我的意思是,重点是什么?看起来更像是传统的bb。计算机语言格式?


不支持所谓的软空间功能是什么?

当前的打印命令,其中逗号后面的空格,如
Hi, your friendly neighborhood n00b here, just wondering why on earth
the Py3K folks want to mess with a simple thing like the "print"
"command" (is that what it''s called, a command?), turning it into
"print()"...I mean, what''s the point, exactly?? To look like a more
"traditional" computer-language format?

And what''s with not supporting the so-called softspace "feature" of
the current "print" command, where a space after a comma, like

>> print" A \ nn"," B" ;
>>print "A\n", "B"



输出


outputs


>> A \ nB $ \\ b
>>A\nB\n



但是使用Py3K它将是


but with Py3K it will be


>> print(" A\ n"," B")
>>print("A\n", "B")



返回


returning


>> A \ n B \ n
>>A\n B\n



????


我很高兴开始学习这门语言,突然之间我发现新版本将会发布一个新版本夏天/早秋

今年 - 一个新版本,不仅没有向后兼容

以前的版本在许多重要方面,但即使它来了

到像打印这样的小东西。命令!!


那是什么意思?


????

I was all excited to start learning the language, when suddenly I find
out that a new version is slated for release late summer/early fall
this year -- a new version which is not only not backwards-compatible
with previous versions in many important ways, but even when it comes
to a little thing like the "print" command!!

What''s up with that??



参见 http://www.python.org/dev/peps/pep-3105/

这应该回答你的所有问题。

See http://www.python.org/dev/peps/pep-3105/
That should answer all your questions.

5月25日晚上8:37,drobi ... @ gmail.com < drobi ... @ gmail.comwrote:
On May 25, 8:37 pm, "drobi...@gmail.com" <drobi...@gmail.comwrote:

>


参见 http://www.python.org/dev/peps/pep-3105/

这应该回答你的所有问题。
>

See http://www.python.org/dev/peps/pep-3105/
That should answer all your questions.



嘿,谢谢,我错过了那个!


不是我理解给出的理由(iman00b),但是哦好吧,所以

它现在看起来像是一个真正的功能。


您是否有任何想法,顺便说一下,是否即将到来的Head First

编程"来自O''Reilly,将于8月份上映,将涵盖Python 3 ??

不太可能,对吗?除非那个人Vern Ceder(作者)在Python开发社区中活跃了吗?


我已经预订了这本书......但是对于旧而言,获得一本书

是没有意义的。 Python 2.x如果它只是像一两年一样被弃用!然后,当前的Python程序仍然有效,

对吗?我的意思是,一旦它被作为可执行文件完成...... PySol或

某些东西应该仍然有用,对吧? (对不起,iman00b,我不是真的

知道这些东西是如何工作的......)

Hey, thanks, I missed that one!

Not that I understand the rationale given (iman00b), but oh well, so
it looks like a real function now.

Might you have any idea, BTW, whether the upcoming "Head First
Programming" from O''Reilly, coming in August, will cover Python 3??
Unlikely, right? Unless maybe if that guy Vern Ceder (the author) is
active in the Python development community??

I''d already pre-ordered the book...but it makes no sense to get a book
on "old" Python 2.x if it''s just going to get deprecated in like a
year or two! Then again, current Python programs would still work,
right? I mean, once it''s been done up as an executable...PySol or
something should still work, right? (Sorry, iman00b, I don''t really
know how this stuff works....)


En Mon,2008年5月26日02:06:02 -0300,战争中的囚徒< pr ************* @yahoo.comescribió:
En Mon, 26 May 2008 02:06:02 -0300, Prisoner at War <pr*************@yahoo.comescribió:

你可能有任何想法,顺便说一句,是否即将推出的Head First

Programming来自O''Reilly,将于8月份上映,将涵盖Python 3 ??

不太可能,对吗?除非那个人Vern Ceder(作者)在Python开发社区中活跃了吗?


我已经预订了这本书......但是对于旧而言,获得一本书

是没有意义的。 Python 2.x如果它只是像一两年一样被弃用!然后,当前的Python程序仍然有效,

对吗?我的意思是,一旦它被作为可执行文件完成...... PySol或

某些东西应该仍然有用,对吧? (对不起,iman00b,我不是真的

知道这些东西是如何工作的......)
Might you have any idea, BTW, whether the upcoming "Head First
Programming" from O''Reilly, coming in August, will cover Python 3??
Unlikely, right? Unless maybe if that guy Vern Ceder (the author) is
active in the Python development community??

I''d already pre-ordered the book...but it makes no sense to get a book
on "old" Python 2.x if it''s just going to get deprecated in like a
year or two! Then again, current Python programs would still work,
right? I mean, once it''s been done up as an executable...PySol or
something should still work, right? (Sorry, iman00b, I don''t really
know how this stuff works....)



差异不是''如此基本或重要:它不是一种全新的语言,只是一些丑陋的旧事物被以不相容的方式被删除或改变(在某些时间它应该发生 - 但不可能在2.x上发生必须保持向后兼容的系列)

此外,Python 3.0将与2.6同时发布,并将有其他2.x版本。 Python 2不会神奇地从地球上消失,我不认为Linux发行版会在短时间内(也许不会在3.1之前)默认使用Python 3.0。

所以学习Python并附了一本书2.5不是浪费时间 - 完全没有。

(这个主题已经在这个小组中多次讨论过了。)


-

Gabriel Genellina

The differences aren''t so fundamental or important: it''s not an entirely new language, just some ugly old things are being removed or changed in incompatible ways (at *some* time it was supposed to happen - but could not happen on the 2.x series which has to remain backwards compatible)
Also, Python 3.0 will be released simultaneously with 2.6, and there will be other 2.x releases. Python 2 won''t magically disappear from Earth, I don''t think Linux distros will come with Python 3.0 by default anytime soon (perhaps not before 3.1).
So learning Python with a book targeted to 2.5 isn''t a waste of time - not at all.
(This subject has already been discussed several times in this group.)

--
Gabriel Genellina


这篇关于为何选择“打印”进入“打印()”????的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆