怎么办!? [英] Now what!?

查看:75
本文介绍了怎么办!?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Grrr ....


我正在关注Python的Byte和while循环。我cp /粘贴

while.py到一个文件并给出777烫发。我mv while.py到while并运行它(./while)

作为一个独立的脚本。我收到错误。


这是剧本:


while.py

http://www.ibiblio.org/swaroopch/byt...statement。 html

当我把它作为.....


$ python而


......它完美无缺。但是,如果我只是简单地运行.....


$ ./而且


......我得到这个:


$ ./while

number:非法号码:=

../while:line 6:running:command找不到

../while:第9行:意外令牌附近的语法错误(''

../while:第9行:guess = int(raw_input(''输入一个整数:''))''


为什么它以一种方式而不是另一种方式工作。如果我运行简单的hello世界

脚本同样的方式($ ./helloworld),它工作得很好。同样的shebang,相同的

dir,相同的许可,等等。我甚至一丝不苟地用手工缩进所有东西

。我错过了吗?


BTW,任何人都知道比slrn / jed更好的cli新闻客户端/编辑器组合(不要等于
甚至认为vi!) ?当我cp /过去代码(或大多数其他东西)到jed时,所有

这些线条变成了阶梯式的。这对于大多数东西来说并不重要,但对于

代码,它这是不可接受的。


nb

Grrr....

I''m following A Byte of Python and into the while loops chap. I cp/paste
while.py to a file and give 777 perms. I mv while.py to while and run it (./while)
as a standalone script. I get errors.

Here is the script:

while.py

http://www.ibiblio.org/swaroopch/byt...statement.html
When I run it as.....

$ python while

......it works perfect. But, if I run it simply as.....

$ ./while

......I get this:

$ ./while
number: illegal number: =
../while: line 6: running: command not found
../while: line 9: syntax error near unexpected token (''
../while: line 9: guess = int(raw_input(''Enter an integer : ''))''

Why does it work one way and not the other. If I run the simple hello world
script the same way ($ ./helloworld) and it works fine. Same shebang, same
dir, same permission, etc. I even meticulously indented everything
perfectly by hand. What am I missing?

BTW, anyone know a better cli news client/editor combo than slrn/jed (don''t
even think vi!)? When I cp/past code (or most anything else) to jed, all
the lines become stair-stepped. This is no biggie for a most stuff, but for
idented code, it''s unacceptable.

nb

推荐答案

python而


......它很完美。但是,如果我只是简单地运行.....

python while

......it works perfect. But, if I run it simply as.....


./而


... ......我明白了:

./while

......I get this:


./而

号码:非法号码:=

../while:第6行:运行:未找到命令

../while:第9行:意外令牌附近的语法错误(''

../while :第9行:guess = int(raw_input(''输入一个整数:''))''


为什么它以单向而不是另一种方式工作。如果我运行简单你好世界

脚本的方式相同(
./while
number: illegal number: =
../while: line 6: running: command not found
../while: line 9: syntax error near unexpected token (''
../while: line 9: guess = int(raw_input(''Enter an integer : ''))''

Why does it work one way and not the other. If I run the simple hello world
script the same way (


这篇关于怎么办!?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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