开发者

Problem with running a program on Pydev in Eclipse

I need your help, I'm using Eclipse and Pydev plugin as python IDE.

I have configured 开发者_运维百科and set environment variables, libraries etc etc I created a project, and a module.

When I write these lines and run the program, it gives an error:

`a = 3
b = 4.6
print "%d is the value of a, %.2f is the value of b" %(a, b)`

and the error message is:

SyntaxError: Non-ASCII character '\xfd' in file C:\Users\dell\workspace\Deneme\src\test1\o3.py on line 9, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

However, when i write the same lines in IDLE, it runs without errors.

What is wrong with Pydev??


Well, the error message pretty much sums it up: There is a non-ascii character in your file. Python 2 source files are expected to be ASCII only, or contain an # -*- coding: <encoding name> -*- (there are other valid forms, see the PEP the error refers to) comment at the top. For Python 3, UTF-8 is allowed too.

I'm pretty sure if you manually navigate to the project folder and run the file, you'll get the same error.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜