基本Python Hello World程序语法错误 [英] Basic Python Hello World Program Syntax Error

查看:429
本文介绍了基本Python Hello World程序语法错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不是编程的新手,但在Python我真的是一个新手,所以当我开始学习Python的教程,他们鼓励我使用IDLE编辑器的Python。作为新手,我有这个奇怪的Hello World问题。

I am not that really new in Programming but in Python I am really a newbie, and so when I started learning Python from the tutorials they encouraged me to use the IDLE editor for Python. And so as a newbie I had this weird Hello World problem.

你可以看到我在Linux中使用Python 2.6.6(CentOS 6.2)

as you can see i use Python 2.6.6 in Linux(CentOS 6.2)

,我尝试了几乎所有可能的语法打印简单的HELLOWORLD提供python 2.6和新的python 3的文档

and I tried almost all the possible syntaxes printing the simple HELLOWORLD provided in the documentation of python 2.6 and the new python 3

我试着打印这样的contants。

I tried printing contants like this

print 1 + 1

并使用输出

>>> 2



我想知道如何打印这个简单的 HELLOWORLD

推荐答案

检查以确保您真的使用直引号。

Check to make sure that you are really using straight quotes. Some programs/systems automatically replace them with curly quotes.

这里尝试复制粘贴并运行它:

Here try copy pasting this and running it:

print "hello"

如果这是一个问题那么您可能需要在 http://unix.stackexchange.com/ 如何禁用此功能。

If this turn's out to be an issue then you might want to ask at http://unix.stackexchange.com/ how to disable such a feature.

这篇关于基本Python Hello World程序语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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