Windows Python 2.4:Unbuffered标志会导致交互式会话出现SyntaxError吗? [英] Windows Python 2.4: Unbuffered flag causes SyntaxError on interactive sessions?

查看:62
本文介绍了Windows Python 2.4:Unbuffered标志会导致交互式会话出现SyntaxError吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

>从Windows 2k和XP上的cmd shell中,我得到了这个奇怪的

语法错误以及unbuffered标志。它工作正常

没有-u。还有其他人遇到过吗?这不会发生在

Python 2.2 ...


C:\> python -u

Python 2.4.1(#65,2005年3月30日,09:13:57)[MSC v.1310 32位(英特尔)]
win32上


输入help ;,版权,信用;或许可证或欲了解更多信息。

print''hello''



文件"< stdin>",第1行

打印''你好''

^

语法错误:无效语法

(对不起,如果这是一个已知/已修复的bug ...我找不到任何关于

吧)

解决方案

Lonnie Princehouse写道:

C:\> python -u
Python 2.4.1(#65,3月30日) 2005年,09:13:57)[MSC v.1310 32位(英特尔)]
关于win32
类型帮助,版权,信用等或许可证或欲了解更多信息。

print''hello''
文件"< stdin>",第1行
打印''你好''
^
SyntaxError:语法无效




Worksforme:


C :\ Python24> python.exe -u

Python 2.4.1(#65,2005年5月24日,13:43:04)[MSC v.1310 32位(英特尔)] on br />
win32

输入help,copyright,credit等等。或许可证或欲了解更多信息。

print''hello''



hello


奇怪你的python版本是从3月30日开始,我的是5月24日。

-

Michael Hoffman


< blockquote> Michael Hoffman写道:

Lonnie Princehouse写道:

C:\> python -u
Python 2.4.1(#65 ,2005年3月30日,09:13:57)[MSC v.1310 32位(英特尔)]
on win32
输入help,copyright,credit等。或许可证或更多信息。

> print''hello''



文件"< stdin>",第1行
打印''你好''
^
SyntaxError :语法无效



Worksforme:

C:\Python24> python.exe -u
Python 2.4.1(#65,May 24 2005年,13:43:04)[MSC v.1310 32位(英特尔)] on
win32
输入help,copyright,credit等等。或许可证或更多信息。

>>>打印''你好''


你好

奇怪的是你的python版本是从3月30日开始的,我的是5月24日。


使用Win XP Home在我的机器上也出现问题,

Python 2.4.1(#65,2005年3月30日,09:13:57)[MSC v.1310 32 bit(英特尔)]在win32

即使只是输入print在交互式提示符处导致语法错误...


--Irmen


很奇怪。你自己构建了Python吗? python.org上的2.4.1版本

是从3月30日开始的。

我刚试过ActiveState的2.4.1 ......同样的事情发生了。 />


>From the cmd shell on both Windows 2k and XP, I''m getting this weird
syntax error in conjunction with the unbuffered flag. It works fine
without -u. Has anyone else encountered it? This didn''t happen with
Python 2.2...

C:\>python -u
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)]
on win32
Type "help", "copyright", "credits" or "license" for more information.

print ''hello''


File "<stdin>", line 1
print ''hello''
^
SyntaxError: invalid syntax
(sorry if this is a known/fixed bug... I couldn''t find anything about
it)

解决方案

Lonnie Princehouse wrote:

C:\>python -u
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)]
on win32
Type "help", "copyright", "credits" or "license" for more information.

print ''hello''
File "<stdin>", line 1
print ''hello''
^
SyntaxError: invalid syntax



Worksforme:

C:\Python24>python.exe -u
Python 2.4.1 (#65, May 24 2005, 13:43:04) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.

print ''hello''


hello

Strange that your python build is from 30 March and mine is from 24 May.
--
Michael Hoffman


Michael Hoffman wrote:

Lonnie Princehouse wrote:

C:\>python -u
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)]
on win32
Type "help", "copyright", "credits" or "license" for more information.

> print ''hello''


File "<stdin>", line 1
print ''hello''
^
SyntaxError: invalid syntax


Worksforme:

C:\Python24>python.exe -u
Python 2.4.1 (#65, May 24 2005, 13:43:04) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.

>>> print ''hello''


hello

Strange that your python build is from 30 March and mine is from 24 May.


Problem also occurs on my machine using Win XP Home,
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32
even just typing "print" at the interactive prompt causes a syntax error...

--Irmen


Weird. Did you build Python yourself? The 2.4.1 release on python.org
is from March 30.
I just tried ActiveState''s 2.4.1... the same thing happens.


这篇关于Windows Python 2.4:Unbuffered标志会导致交互式会话出现SyntaxError吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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