Python基础01 Hello World!

	<div class="clear"></div>
	<div class="postBody">
		<div id="cnblogs_post_body" class="blogpost-body"><p><span style="font-family: 'courier new', courier;"></span></p>

 

简单的‘Hello World!’

 

Python命令行

假设你已经安装好了Python, 那么在Linux命令行输入:

$python

将直接进入python。然后在命令行提示符>>>后面输入:

>>>print('Hello World!')

可以看到,随后在屏幕上输出:

Hello World!

print是一个常用函数,其功能就是输出括号中得字符串。

(在Python 2.x中,print还可以是一个关键字,可写成print 'Hello World!',但这在3.x中行不通 )

 

写一段小程序

另一个使用Python的方法,是写一个Python程序。用文本编辑器写一个.py结尾的文件,比如说hello.py

hello.py中写入如下,并保存:

print('Hello World!')

退出文本编辑器,然后在命令行输入:

$python hello.py

来运行hello.py。可以看到Python随后输出

Hello World!

 

脚本

我们还可以把Python程序hello.py改成一个可执行的脚本,直接执行:

#!/usr/bin/env python
print('Hello World!')

 

需要修改上面程序的权限为可执行:

chmod 755 hello.py

 

然后再命令行中,输入

./hello.py

就可以直接运行了

 

总结

print

命令行模式: 运行Python,在命令行输入命令并执行。

程序模式: 写一段Python程序并运行。

如果你喜欢这篇文章,欢迎推荐

技术推动进步,分享促进社区。

标签: Python
35
0
« 上一篇:Python快速教程 (手册)
» 下一篇:Python基础02 基本数据类型
	</div>
	<div class="postDesc">posted @ <span id="post-date">2012-05-28 17:23</span> <a href="http://www.cnblogs.com/vamei/">Vamei</a> 阅读(<span id="post_view_count">197235</span>) 评论(<span id="post_comment_count">30</span>)  <a href="https://i.cnblogs.com/EditPosts.aspx?postid=2521650" rel="nofollow">编辑</a> <a href="#" onclick="AddToWz(2521650);return false;">收藏</a></div>
</div>
<script type="text/javascript">var allowComments=true,cb_blogId=118754,cb_entryId=2521650,cb_blogApp=currentBlogApp,cb_blogUserGuid='3faf47ff-9ea8-e111-aa3f-842b2b196315',cb_entryCreatedDate='2012/5/28 17:23:00';loadViewCount(cb_entryId);var cb_postType=1;</script>
	<div class="feedbackItem">
		<div class="feedbackListSubtitle">
			<div class="feedbackManage">
				&nbsp;&nbsp;<span class="comment_actions"><a href="javascript:void(0);" onclick="return ReplyComment(2574500,'5JbtPeXCvbAj+dZUkZ0ohy6MxWvjMz+Gz66xHz/MZeDmkeW3UT42MQ==')">回复</a><a href="javascript:void(0);" onclick="return QuoteComment(2574500,'5JbtPeXCvbAj+dZUkZ0ohy6MxWvjMz+Gz66xHz/MZeDmkeW3UT42MQ==')">引用</a></span>
			</div>
			<a href="#2574500" class="layer">#1楼</a><a name="2574500" id="comment_anchor_2574500"></a>  <span class="comment_date">2012-12-10 21:00</span> <a id="a_comment_author_2574500" href="http://www.cnblogs.com/johnwonder/" target="_blank">john23.net</a> <a href="http://msg.cnblogs.com/send/john23.net" title="发送站内短消息" class="sendMsg2This">&nbsp;</a>
		</div>
		<div class="feedbackCon">
			<div id="comment_body_2574500" class="blog_comment_body">感谢分享</div><div class="comment_vote"><a href="javascript:void(0);" class="comment_digg" onclick="return voteComment(2574500,'Digg',this)">支持(0)</a><a href="javascript:void(0);" class="comment_bury" onclick="return voteComment(2574500,'Bury',this)">反对(0)</a></div><span id="comment_2574500_avatar" style="display:none;">http://pic.cnblogs.com/face/u64521.jpg</span>
		</div>
	</div>

	<div class="feedbackItem">
		<div class="feedbackListSubtitle">
			<div class="feedbackManage">
				&nbsp;&nbsp;<span class="comment_actions"><a href="javascript:void(0);" onclick="return ReplyComment(2604709,'Pjdu85slY6XrzvxmdBbYg6qKUwUFJLiYw6zq1ZDowliU7I4wWnsSnQ==')">回复</a><a href="javascript:void(0);" onclick="return QuoteComment(2604709,'Pjdu85slY6XrzvxmdBbYg6qKUwUFJLiYw6zq1ZDowliU7I4wWnsSnQ==')">引用</a></span>
			</div>
			<a href="#2604709" class="layer">#2楼</a><a name="2604709" id="comment_anchor_2604709"></a>  <span class="comment_date">2013-01-22 08:59</span> <a id="a_comment_author_2604709" href="http://home.cnblogs.com/u/487926/" target="_blank">韵味</a> <a href="http://msg.cnblogs.com/send/%E9%9F%B5%E5%91%B3" title="发送站内短消息" class="sendMsg2This">&nbsp;</a>
		</div>
		<div class="feedbackCon">
			<div id="comment_body_2604709" class="blog_comment_body">hi,博主,想问下您,通常都用什么工具编写python,Vim或IDIE或Eclipse 还是其他的,那个方便点。</div><div class="comment_vote"><a href="javascript:void(0);" class="comment_digg" onclick="return voteComment(2604709,'Digg',this)">支持(0)</a><a href="javascript:void(0);" class="comment_bury" onclick="return voteComment(2604709,'Bury',this)">反对(0)</a></div>
		</div>
	</div>

	<div class="feedbackItem">
		<div class="feedbackListSubtitle">
			<div class="feedbackManage">
				&nbsp;&nbsp;<span class="comment_actions"><a href="javascript:void(0);" onclick="return ReplyComment(2604727,'Vbw54O+7HsLA+9mlMI3W3vxkhVcKzpgYD8CuAa02Zzlv3wzmzxfEnA==')">回复</a><a href="javascript:void(0);" onclick="return QuoteComment(2604727,'Vbw54O+7HsLA+9mlMI3W3vxkhVcKzpgYD8CuAa02Zzlv3wzmzxfEnA==')">引用</a></span>
			</div>
			<a href="#2604727" class="layer">#3楼</a><a name="2604727" id="comment_anchor_2604727"></a>[<span class="louzhu">楼主</span>]  <span class="comment_date">2013-01-22 09:14</span> <a id="a_comment_author_2604727" href="http://www.cnblogs.com/vamei/" target="_blank">Vamei</a> <a href="http://msg.cnblogs.com/send/Vamei" title="发送站内短消息" class="sendMsg2This">&nbsp;</a>
		</div>
		<div class="feedbackCon">
			<div id="comment_body_2604727" class="blog_comment_body"><a href="#2604709" title="查看所回复的评论" onclick="commentManager.renderComments(0,50,2604709);">@</a>

韵味
我用过vim和idle,现在主要是vim。
我觉得vim就挺方便的,用多了的原因。



	<div class="feedbackItem">
		<div class="feedbackListSubtitle">
			<div class="feedbackManage">
				&nbsp;&nbsp;<span class="comment_actions"><a href="javascript:void(0);" onclick="return ReplyComment(2687001,'qZgZSAI77+Y2TLsJyXMFr4Au8FTWeabaLQE+zaid/flUz/28yOHB1Q==')">回复</a><a href="javascript:void(0);" onclick="return QuoteComment(2687001,'qZgZSAI77+Y2TLsJyXMFr4Au8FTWeabaLQE+zaid/flUz/28yOHB1Q==')">引用</a></span>
			</div>
			<a href="#2687001" class="layer">#4楼</a><a name="2687001" id="comment_anchor_2687001"></a>  <span class="comment_date">2013-05-22 15:20</span> <a id="a_comment_author_2687001" href="http://home.cnblogs.com/u/472784/" target="_blank">nsdont</a> <a href="http://msg.cnblogs.com/send/nsdont" title="发送站内短消息" class="sendMsg2This">&nbsp;</a>
		</div>
		<div class="feedbackCon">
			<div id="comment_body_2687001" class="blog_comment_body">博主,你用vim写python时, 有用到什么插件没,求推荐,求指导</div><div class="comment_vote"><a href="javascript:void(0);" class="comment_digg" onclick="return voteComment(2687001,'Digg',this)">支持(0)</a><a href="javascript:void(0);" class="comment_bury" onclick="return voteComment(2687001,'Bury',this)">反对(0)</a></div>
		</div>
	</div>

	<div class="feedbackItem">
		<div class="feedbackListSubtitle">
			<div class="feedbackManage">
				&nbsp;&nbsp;<span class="comment_actions"><a href="javascript:void(0);" onclick="return ReplyComment(2687089,'Vbw54O+7HsLA+9mlMI3W3vxkhVcKzpgYD8CuAa02Zzlv3wzmzxfEnA==')">回复</a><a href="javascript:void(0);" onclick="return QuoteComment(2687089,'Vbw54O+7HsLA+9mlMI3W3vxkhVcKzpgYD8CuAa02Zzlv3wzmzxfEnA==')">引用</a></span>
			</div>
			<a href="#2687089" class="layer">#5楼</a><a name="2687089" id="comment_anchor_2687089"></a>[<span class="louzhu">楼主</span>]  <span class="comment_date">2013-05-22 16:37</span> <a id="a_comment_author_2687089" href="http://www.cnblogs.com/vamei/" target="_blank">Vamei</a> <a href="http://msg.cnblogs.com/send/Vamei" title="发送站内短消息" class="sendMsg2This">&nbsp;</a>
		</div>
		<div class="feedbackCon">
			<div id="comment_body_2687089" class="blog_comment_body"><a href="#2687001" title="查看所回复的评论" onclick="commentManager.renderComments(0,50,2687001);">@</a>

nsdont
没有…… vim有Python高亮,这就够了。



	<div class="feedbackItem">
		<div class="feedbackListSubtitle">
			<div class="feedbackManage">
				&nbsp;&nbsp;<span class="comment_actions"><a href="javascript:void(0);" onclick="return ReplyComment(2687110,'qZgZSAI77+Y2TLsJyXMFr4Au8FTWeabaLQE+zaid/flUz/28yOHB1Q==')">回复</a><a href="javascript:void(0);" onclick="return QuoteComment(2687110,'qZgZSAI77+Y2TLsJyXMFr4Au8FTWeabaLQE+zaid/flUz/28yOHB1Q==')">引用</a></span>
			</div>
			<a href="#2687110" class="layer">#6楼</a><a name="2687110" id="comment_anchor_2687110"></a>  <span class="comment_date">2013-05-22 16:52</span> <a id="a_comment_author_2687110" href="http://home.cnblogs.com/u/472784/" target="_blank">nsdont</a> <a href="http://msg.cnblogs.com/send/nsdont" title="发送站内短消息" class="sendMsg2This">&nbsp;</a>
		</div>
		<div class="feedbackCon">
			<div id="comment_body_2687110" class="blog_comment_body"><a href="#2687089" title="查看所回复的评论" onclick="commentManager.renderComments(0,50,2687089);">@</a>

Vamei
嗯,这就足以了,是我贪多了



	<div class="feedbackItem">
		<div class="feedbackListSubtitle">
			<div class="feedbackManage">
				&nbsp;&nbsp;<span class="comment_actions"><a href="javascript:void(0);" onclick="return ReplyComment(2687208,'Vbw54O+7HsLA+9mlMI3W3vxkhVcKzpgYD8CuAa02Zzlv3wzmzxfEnA==')">回复</a><a href="javascript:void(0);" onclick="return QuoteComment(2687208,'Vbw54O+7HsLA+9mlMI3W3vxkhVcKzpgYD8CuAa02Zzlv3wzmzxfEnA==')">引用</a></span>
			</div>
			<a href="#2687208" class="layer">#7楼</a><a name="2687208" id="comment_anchor_2687208"></a>[<span class="louzhu">楼主</span>]  <span class="comment_date">2013-05-22 18:10</span> <a id="a_comment_author_2687208" href="http://www.cnblogs.com/vamei/" target="_blank">Vamei</a> <a href="http://msg.cnblogs.com/send/Vamei" title="发送站内短消息" class="sendMsg2This">&nbsp;</a>
		</div>
		<div class="feedbackCon">
			<div id="comment_body_2687208" class="blog_comment_body"><a href="#2687110" title="查看所回复的评论" onclick="commentManager.renderComments(0,50,2687110);">@</a>

nsdont
我有点懒,总觉得够用就行。你可以探索一下插件。



	<div class="feedbackItem">
		<div class="feedbackListSubtitle">
			<div class="feedbackManage">
				&nbsp;&nbsp;<span class="comment_actions"><a href="javascript:void(0);" onclick="return ReplyComment(2688496,'r140LEb5n3K1xmawj4dhugL8NNLNEwvT68y1ko+6qqI4ZKMxynvgxA==')">回复</a><a href="javascript:void(0);" onclick="return QuoteComment(2688496,'r140LEb5n3K1xmawj4dhugL8NNLNEwvT68y1ko+6qqI4ZKMxynvgxA==')">引用</a></span>
			</div>
			<a href="#2688496" class="layer">#8楼</a><a name="2688496" id="comment_anchor_2688496"></a>  <span class="comment_date">2013-05-24 09:30</span> <a id="a_comment_author_2688496" href="http://www.cnblogs.com/whthomas/" target="_blank">whthomas</a> <a href="http://msg.cnblogs.com/send/whthomas" title="发送站内短消息" class="sendMsg2This">&nbsp;</a>
		</div>
		<div class="feedbackCon">
			<div id="comment_body_2688496" class="blog_comment_body"><a href="#2687110" title="查看所回复的评论" onclick="commentManager.renderComments(0,50,2687110);">@</a>

nsdont
ipython



	<div class="feedbackItem">
		<div class="feedbackListSubtitle">
			<div class="feedbackManage">
				&nbsp;&nbsp;<span class="comment_actions"><a href="javascript:void(0);" onclick="return ReplyComment(2859972,'AfblFGxC610i52T43mFEZa8vrzOvaiW1kJMsaqD0lWgQ9G5d747wlw==')">回复</a><a href="javascript:void(0);" onclick="return QuoteComment(2859972,'AfblFGxC610i52T43mFEZa8vrzOvaiW1kJMsaqD0lWgQ9G5d747wlw==')">引用</a></span>
			</div>
			<a href="#2859972" class="layer">#9楼</a><a name="2859972" id="comment_anchor_2859972"></a>  <span class="comment_date">2014-01-13 13:45</span> <a id="a_comment_author_2859972" href="http://home.cnblogs.com/u/595523/" target="_blank">lestatzb</a> <a href="http://msg.cnblogs.com/send/lestatzb" title="发送站内短消息" class="sendMsg2This">&nbsp;</a>
		</div>
		<div class="feedbackCon">
			<div id="comment_body_2859972" class="blog_comment_body">有微博orQQ吗?关注一下【我爱数据分析网】。我转载</div><div class="comment_vote"><a href="javascript:void(0);" class="comment_digg" onclick="return voteComment(2859972,'Digg',this)">支持(0)</a><a href="javascript:void(0);" class="comment_bury" onclick="return voteComment(2859972,'Bury',this)">反对(0)</a></div>
		</div>
	</div>

	<div class="feedbackItem">
		<div class="feedbackListSubtitle">
			<div class="feedbackManage">
				&nbsp;&nbsp;<span class="comment_actions"><a href="javascript:void(0);" onclick="return ReplyComment(2917041,'ip2sBxAoJwC/4zC6fiQSHBCqQSr1emIVazAQSsGUidVnrGOdpJJPEg==')">回复</a><a href="javascript:void(0);" onclick="return QuoteComment(2917041,'ip2sBxAoJwC/4zC6fiQSHBCqQSr1emIVazAQSsGUidVnrGOdpJJPEg==')">引用</a></span>
			</div>
			<a href="#2917041" class="layer">#10楼</a><a name="2917041" id="comment_anchor_2917041"></a>  <span class="comment_date">2014-04-14 09:08</span> <a id="a_comment_author_2917041" href="http://home.cnblogs.com/u/616161/" target="_blank">安静从容</a> <a href="http://msg.cnblogs.com/send/%E5%AE%89%E9%9D%99%E4%BB%8E%E5%AE%B9" title="发送站内短消息" class="sendMsg2This">&nbsp;</a>
		</div>
		<div class="feedbackCon">
			<div id="comment_body_2917041" class="blog_comment_body">我觉得这里应该补充上在编写脚本的格式注意事项<br><div class="cnblogs_Highlighter sh-gutter"><div><div id="highlighter_41881" class="syntaxhighlighter  python"><div class="toolbar"><span><a href="#" class="toolbar_item command_help help">?</a></span></div><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="gutter"><div class="line number1 index0 alt2">1</div><div class="line number2 index1 alt1">2</div></td><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="python comments">#!/usr/bin/env&nbsp;&nbsp; python</code></div><div class="line number2 index1 alt1"><code class="python functions">print</code> <code class="python plain">‘hello world'</code></div></div></td></tr></tbody></table></div></div></div></div><div class="comment_vote"><a href="javascript:void(0);" class="comment_digg" onclick="return voteComment(2917041,'Digg',this)">支持(0)</a><a href="javascript:void(0);" class="comment_bury" onclick="return voteComment(2917041,'Bury',this)">反对(0)</a></div>
		</div>
	</div>

	<div class="feedbackItem">
		<div class="feedbackListSubtitle">
			<div class="feedbackManage">
				&nbsp;&nbsp;<span class="comment_actions"><a href="javascript:void(0);" onclick="return ReplyComment(2917121,'Vbw54O+7HsLA+9mlMI3W3vxkhVcKzpgYD8CuAa02Zzlv3wzmzxfEnA==')">回复</a><a href="javascript:void(0);" onclick="return QuoteComment(2917121,'Vbw54O+7HsLA+9mlMI3W3vxkhVcKzpgYD8CuAa02Zzlv3wzmzxfEnA==')">引用</a></span>
			</div>
			<a href="#2917121" class="layer">#11楼</a><a name="2917121" id="comment_anchor_2917121"></a>[<span class="louzhu">楼主</span>]  <span class="comment_date">2014-04-14 10:10</span> <a id="a_comment_author_2917121" href="http://www.cnblogs.com/vamei/" target="_blank">Vamei</a> <a href="http://msg.cnblogs.com/send/Vamei" title="发送站内短消息" class="sendMsg2This">&nbsp;</a>
		</div>
		<div class="feedbackCon">
			<div id="comment_body_2917121" class="blog_comment_body"><a href="#2917041" title="查看所回复的评论" onclick="commentManager.renderComments(0,50,2917041);">@</a>

安静从容
有道理。我修改一下。



	<div class="feedbackItem">
		<div class="feedbackListSubtitle">
			<div class="feedbackManage">
				&nbsp;&nbsp;<span class="comment_actions"><a href="javascript:void(0);" onclick="return ReplyComment(2921032,'e5tf4l21QMrL51rfUDy4z1xjhcvVvHzfKjldJoUN8bNnnYChFBj/wg==')">回复</a><a href="javascript:void(0);" onclick="return QuoteComment(2921032,'e5tf4l21QMrL51rfUDy4z1xjhcvVvHzfKjldJoUN8bNnnYChFBj/wg==')">引用</a></span>
			</div>
			<a href="#2921032" class="layer">#12楼</a><a name="2921032" id="comment_anchor_2921032"></a>  <span class="comment_date">2014-04-19 07:07</span> <a id="a_comment_author_2921032" href="http://home.cnblogs.com/u/625495/" target="_blank">yato</a> <a href="http://msg.cnblogs.com/send/yato" title="发送站内短消息" class="sendMsg2This">&nbsp;</a>
		</div>
		<div class="feedbackCon">
			<div id="comment_body_2921032" class="blog_comment_body">楼主,请教下个简单的问题:写一段程序中“退出文本编辑器,然后在命令行输入:$python hello.py来运行hello.py。可以看到Python随后输出”------为什么我操作后提示$为invalid syntax. 一直不明白?求教</div><div class="comment_vote"><a href="javascript:void(0);" class="comment_digg" onclick="return voteComment(2921032,'Digg',this)">支持(2)</a><a href="javascript:void(0);" class="comment_bury" onclick="return voteComment(2921032,'Bury',this)">反对(0)</a></div>
		</div>
	</div>

	<div class="feedbackItem">
		<div class="feedbackListSubtitle">
			<div class="feedbackManage">
				&nbsp;&nbsp;<span class="comment_actions"><a href="javascript:void(0);" onclick="return ReplyComment(2921447,'Vbw54O+7HsLA+9mlMI3W3vxkhVcKzpgYD8CuAa02Zzlv3wzmzxfEnA==')">回复</a><a href="javascript:void(0);" onclick="return QuoteComment(2921447,'Vbw54O+7HsLA+9mlMI3W3vxkhVcKzpgYD8CuAa02Zzlv3wzmzxfEnA==')">引用</a></span>
			</div>
			<a href="#2921447" class="layer">#13楼</a><a name="2921447" id="comment_anchor_2921447"></a>[<span class="louzhu">楼主</span>]  <span class="comment_date">2014-04-20 13:40</span> <a id="a_comment_author_2921447" href="http://www.cnblogs.com/vamei/" target="_blank">Vamei</a> <a href="http://msg.cnblogs.com/send/Vamei" title="发送站内短消息" class="sendMsg2This">&nbsp;</a>
		</div>
		<div class="feedbackCon">
			<div id="comment_body_2921447" class="blog_comment_body"><a href="#2921032" title="查看所回复的评论" onclick="commentManager.renderComments(0,50,2921032);">@</a>

yato
$是提示符,不用输入的。



	<div class="feedbackItem">
		<div class="feedbackListSubtitle">
			<div class="feedbackManage">
				&nbsp;&nbsp;<span class="comment_actions"><a href="javascript:void(0);" onclick="return ReplyComment(2960169,'bxszYASvdroPWHr/ODXbhTTOyXOT5V6JB7DUMcw4jwqP3b6hCWP89Q==')">回复</a><a href="javascript:void(0);" onclick="return QuoteComment(2960169,'bxszYASvdroPWHr/ODXbhTTOyXOT5V6JB7DUMcw4jwqP3b6hCWP89Q==')">引用</a></span>
			</div>
			<a href="#2960169" class="layer">#14楼</a><a name="2960169" id="comment_anchor_2960169"></a>  <span class="comment_date">2014-06-08 18:24</span> <a id="a_comment_author_2960169" href="http://home.cnblogs.com/u/640973/" target="_blank">madscientist</a> <a href="http://msg.cnblogs.com/send/madscientist" title="发送站内短消息" class="sendMsg2This">&nbsp;</a>
		</div>
		<div class="feedbackCon">
			<div id="comment_body_2960169" class="blog_comment_body">博主 如果是零基础学习Python 适合看你这个教程吗?还是有什么别的教程推荐呢?谢谢!</div><div class="comment_vote"><a href="javascript:void(0);" class="comment_digg" onclick="return voteComment(2960169,'Digg',this)">支持(0)</a><a href="javascript:void(0);" class="comment_bury" onclick="return voteComment(2960169,'Bury',this)">反对(0)</a></div>
		</div>
	</div>

	<div class="feedbackItem">
		<div class="feedbackListSubtitle">
			<div class="feedbackManage">
				&nbsp;&nbsp;<span class="comment_actions"><a href="javascript:void(0);" onclick="return ReplyComment(2972358,'WW8Ra21c5UOmOr0lbUYN97AZ68cAGVh/W3NUqgPlK5clXFH4SeYzEA==')">回复</a><a href="javascript:void(0);" onclick="return QuoteComment(2972358,'WW8Ra21c5UOmOr0lbUYN97AZ68cAGVh/W3NUqgPlK5clXFH4SeYzEA==')">引用</a></span>
			</div>
			<a href="#2972358" class="layer">#15楼</a><a name="2972358" id="comment_anchor_2972358"></a>  <span class="comment_date">2014-06-26 19:10</span> <a id="a_comment_author_2972358" href="http://home.cnblogs.com/u/645838/" target="_blank">Kay L</a> <a href="http://msg.cnblogs.com/send/Kay%20L" title="发送站内短消息" class="sendMsg2This">&nbsp;</a>
		</div>
		<div class="feedbackCon">
			<div id="comment_body_2972358" class="blog_comment_body">我装了一个Macvim,用的电脑是macbook,但是不知道怎么运行,好郁闷</div><div class="comment_vote"><a href="javascript:void(0);" class="comment_digg" onclick="return voteComment(2972358,'Digg',this)">支持(0)</a><a href="javascript:void(0);" class="comment_bury" onclick="return voteComment(2972358,'Bury',this)">反对(0)</a></div>
		</div>
	</div>

	<div class="feedbackItem">
		<div class="feedbackListSubtitle">
			<div class="feedbackManage">
				&nbsp;&nbsp;<span class="comment_actions"><a href="javascript:void(0);" onclick="return ReplyComment(3089056,'zFgcHI+Di0/EAAjKI7HJCSrnPxg7/wIBluIAokZsze4gpz2AA2yXfw==')">回复</a><a href="javascript:void(0);" onclick="return QuoteComment(3089056,'zFgcHI+Di0/EAAjKI7HJCSrnPxg7/wIBluIAokZsze4gpz2AA2yXfw==')">引用</a></span>
			</div>
			<a href="#3089056" class="layer">#16楼</a><a name="3089056" id="comment_anchor_3089056"></a>  <span class="comment_date">2014-12-18 15:27</span> <a id="a_comment_author_3089056" href="http://home.cnblogs.com/u/689007/" target="_blank">shanwl0919</a> <a href="http://msg.cnblogs.com/send/shanwl0919" title="发送站内短消息" class="sendMsg2This">&nbsp;</a>
		</div>
		<div class="feedbackCon">
			<div id="comment_body_3089056" class="blog_comment_body">为什么我用python  hello.py来运行,总是会报NameError: name 'python' is not defined错,这个是什么原因</div><div class="comment_vote"><a href="javascript:void(0);" class="comment_digg" onclick="return voteComment(3089056,'Digg',this)">支持(0)</a><a href="javascript:void(0);" class="comment_bury" onclick="return voteComment(3089056,'Bury',this)">反对(0)</a></div>
		</div>
	</div>

	<div class="feedbackItem">
		<div class="feedbackListSubtitle">
			<div class="feedbackManage">
				&nbsp;&nbsp;<span class="comment_actions"><a href="javascript:void(0);" onclick="return ReplyComment(3118888,'vwYYYEptOh2uTxiePRJjw2IJq3dckOIv9FOTPTAjptUus64m51cLzg==')">回复</a><a href="javascript:void(0);" onclick="return QuoteComment(3118888,'vwYYYEptOh2uTxiePRJjw2IJq3dckOIv9FOTPTAjptUus64m51cLzg==')">引用</a></span>
			</div>
			<a href="#3118888" class="layer">#17楼</a><a name="3118888" id="comment_anchor_3118888"></a>  <span class="comment_date">2015-01-29 16:10</span> <a id="a_comment_author_3118888" href="http://www.cnblogs.com/biang/" target="_blank">biangbiang</a> <a href="http://msg.cnblogs.com/send/biangbiang" title="发送站内短消息" class="sendMsg2This">&nbsp;</a>
		</div>
		<div class="feedbackCon">
			<div id="comment_body_3118888" class="blog_comment_body"><a href="#3089056" title="查看所回复的评论" onclick="commentManager.renderComments(0,50,3089056);">@</a>

shanwl0919
电脑没装python吧?或者没配好环境变量。。



	<div class="feedbackItem">
		<div class="feedbackListSubtitle">
			<div class="feedbackManage">
				&nbsp;&nbsp;<span class="comment_actions"><a href="javascript:void(0);" onclick="return ReplyComment(3132144,'j1yD5u0GRTdOM4jvDNLdba+WAWexl15TGfym/Ee0KQjrTL1vkNXUyg==')">回复</a><a href="javascript:void(0);" onclick="return QuoteComment(3132144,'j1yD5u0GRTdOM4jvDNLdba+WAWexl15TGfym/Ee0KQjrTL1vkNXUyg==')">引用</a></span>
			</div>
			<a href="#3132144" class="layer">#18楼</a><a name="3132144" id="comment_anchor_3132144"></a>  <span class="comment_date">2015-02-27 10:19</span> <a id="a_comment_author_3132144" href="http://www.cnblogs.com/bxbz/" target="_blank">无言的蜗牛</a> <a href="http://msg.cnblogs.com/send/%E6%97%A0%E8%A8%80%E7%9A%84%E8%9C%97%E7%89%9B" title="发送站内短消息" class="sendMsg2This">&nbsp;</a>
		</div>
		<div class="feedbackCon">
			<div id="comment_body_3132144" class="blog_comment_body">没找到有带页面的开发工具  感觉写的python只是一个很小的程序 很混乱</div><div class="comment_vote"><a href="javascript:void(0);" class="comment_digg" onclick="return voteComment(3132144,'Digg',this)">支持(0)</a><a href="javascript:void(0);" class="comment_bury" onclick="return voteComment(3132144,'Bury',this)">反对(0)</a></div>
		</div>
	</div>

	<div class="feedbackItem">
		<div class="feedbackListSubtitle">
			<div class="feedbackManage">
				&nbsp;&nbsp;<span class="comment_actions"><a href="javascript:void(0);" onclick="return ReplyComment(3144919,'dyC7E9nB8IBQeJ1QQg7C1P+rh+8dATbGS782nh6f+8eR9Favfx5OAQ==')">回复</a><a href="javascript:void(0);" onclick="return QuoteComment(3144919,'dyC7E9nB8IBQeJ1QQg7C1P+rh+8dATbGS782nh6f+8eR9Favfx5OAQ==')">引用</a></span>
			</div>
			<a href="#3144919" class="layer">#19楼</a><a name="3144919" id="comment_anchor_3144919"></a>  <span class="comment_date">2015-03-20 10:33</span> <a id="a_comment_author_3144919" href="http://home.cnblogs.com/u/620311/" target="_blank">快乐的昏析师</a> <a href="http://msg.cnblogs.com/send/%E5%BF%AB%E4%B9%90%E7%9A%84%E6%98%8F%E6%9E%90%E5%B8%88" title="发送站内短消息" class="sendMsg2This">&nbsp;</a>
		</div>
		<div class="feedbackCon">
			<div id="comment_body_3144919" class="blog_comment_body">你好,请问给教程是否不适合windows 系统?如果不适合,有windows系统的教程吗?谢谢!</div><div class="comment_vote"><a href="javascript:void(0);" class="comment_digg" onclick="return voteComment(3144919,'Digg',this)">支持(0)</a><a href="javascript:void(0);" class="comment_bury" onclick="return voteComment(3144919,'Bury',this)">反对(0)</a></div>
		</div>
	</div>

	<div class="feedbackItem">
		<div class="feedbackListSubtitle">
			<div class="feedbackManage">
				&nbsp;&nbsp;<span class="comment_actions"><a href="javascript:void(0);" onclick="return ReplyComment(3145262,'wcOp+RRnp/K59xoBR3r9PIuos0rtNE7N3crVZ2j7WW2RflK1rwXhAg==')">回复</a><a href="javascript:void(0);" onclick="return QuoteComment(3145262,'wcOp+RRnp/K59xoBR3r9PIuos0rtNE7N3crVZ2j7WW2RflK1rwXhAg==')">引用</a></span>
			</div>
			<a href="#3145262" class="layer">#20楼</a><a name="3145262" id="comment_anchor_3145262"></a>  <span class="comment_date">2015-03-20 15:38</span> <a id="a_comment_author_3145262" href="http://www.cnblogs.com/sysman/" target="_blank">sysman</a> <a href="http://msg.cnblogs.com/send/sysman" title="发送站内短消息" class="sendMsg2This">&nbsp;</a>
		</div>
		<div class="feedbackCon">
			<div id="comment_body_3145262" class="blog_comment_body">其实python源文件不必要py结尾的</div><div class="comment_vote"><a href="javascript:void(0);" class="comment_digg" onclick="return voteComment(3145262,'Digg',this)">支持(0)</a><a href="javascript:void(0);" class="comment_bury" onclick="return voteComment(3145262,'Bury',this)">反对(0)</a></div><span id="comment_3145262_avatar" style="display:none;">http://pic.cnblogs.com/face/508475/20130324103250.png</span>
		</div>
	</div>

	<div class="feedbackItem">
		<div class="feedbackListSubtitle">
			<div class="feedbackManage">
				&nbsp;&nbsp;<span class="comment_actions"><a href="javascript:void(0);" onclick="return ReplyComment(3147895,'e1OBQZX7Kbwclx9t0VS88b1zZcN+ONAM6tqJSdXUGHgO0y9caY0Amw==')">回复</a><a href="javascript:void(0);" onclick="return QuoteComment(3147895,'e1OBQZX7Kbwclx9t0VS88b1zZcN+ONAM6tqJSdXUGHgO0y9caY0Amw==')">引用</a></span>
			</div>
			<a href="#3147895" class="layer">#21楼</a><a name="3147895" id="comment_anchor_3147895"></a>  <span class="comment_date">2015-03-24 22:09</span> <a id="a_comment_author_3147895" href="http://home.cnblogs.com/u/721551/" target="_blank">liuhang</a> <a href="http://msg.cnblogs.com/send/liuhang" title="发送站内短消息" class="sendMsg2This">&nbsp;</a>
		</div>
		<div class="feedbackCon">
			<div id="comment_body_3147895" class="blog_comment_body">直接看了</div><div class="comment_vote"><a href="javascript:void(0);" class="comment_digg" onclick="return voteComment(3147895,'Digg',this)">支持(0)</a><a href="javascript:void(0);" class="comment_bury" onclick="return voteComment(3147895,'Bury',this)">反对(0)</a></div>
		</div>
	</div>

	<div class="feedbackItem">
		<div class="feedbackListSubtitle">
			<div class="feedbackManage">
				&nbsp;&nbsp;<span class="comment_actions"><a href="javascript:void(0);" onclick="return ReplyComment(3266689,'2e0SMXBoSyIFESZFnnJaEdAv3cyjXEyiBLQ+nnTjk4vxApj/OKBwLA==')">回复</a><a href="javascript:void(0);" onclick="return QuoteComment(3266689,'2e0SMXBoSyIFESZFnnJaEdAv3cyjXEyiBLQ+nnTjk4vxApj/OKBwLA==')">引用</a></span>
			</div>
			<a href="#3266689" class="layer">#22楼</a><a name="3266689" id="comment_anchor_3266689"></a>  <span class="comment_date">2015-09-14 22:29</span> <a id="a_comment_author_3266689" href="http://www.cnblogs.com/yana/" target="_blank">yana789</a> <a href="http://msg.cnblogs.com/send/yana789" title="发送站内短消息" class="sendMsg2This">&nbsp;</a>
		</div>
		<div class="feedbackCon">
			<div id="comment_body_3266689" class="blog_comment_body">windows下的python和linux下的python,安装后运行文本编辑的hello.py是一样吗?我是在windows下安装的python,在IDLE下运行¥python hello.py,提示syntaxerro。谢谢楼主解答</div><div class="comment_vote"><a href="javascript:void(0);" class="comment_digg" onclick="return voteComment(3266689,'Digg',this)">支持(0)</a><a href="javascript:void(0);" class="comment_bury" onclick="return voteComment(3266689,'Bury',this)">反对(0)</a></div>
		</div>
	</div>

	<div class="feedbackItem">
		<div class="feedbackListSubtitle">
			<div class="feedbackManage">
				&nbsp;&nbsp;<span class="comment_actions"><a href="javascript:void(0);" onclick="return ReplyComment(3331599,'w5i8VRvVswichMhiXeNQar7pk8Pzq+iqjsbFvTE4xxt2Yl/SYh+oCg==')">回复</a><a href="javascript:void(0);" onclick="return QuoteComment(3331599,'w5i8VRvVswichMhiXeNQar7pk8Pzq+iqjsbFvTE4xxt2Yl/SYh+oCg==')">引用</a></span>
			</div>
			<a href="#3331599" class="layer">#23楼</a><a name="3331599" id="comment_anchor_3331599"></a>  <span class="comment_date">2015-12-21 22:53</span> <a id="a_comment_author_3331599" href="http://www.cnblogs.com/liwei0526vip/" target="_blank">肖邦linux</a> <a href="http://msg.cnblogs.com/send/%E8%82%96%E9%82%A6linux" title="发送站内短消息" class="sendMsg2This">&nbsp;</a>
		</div>
		<div class="feedbackCon">
			<div id="comment_body_3331599" class="blog_comment_body">强大的很,楼主的分享精神很值得赞一个。</div><div class="comment_vote"><a href="javascript:void(0);" class="comment_digg" onclick="return voteComment(3331599,'Digg',this)">支持(0)</a><a href="javascript:void(0);" class="comment_bury" onclick="return voteComment(3331599,'Bury',this)">反对(0)</a></div><span id="comment_3331599_avatar" style="display:none;">http://pic.cnblogs.com/face/781035/20180506171724.png</span>
		</div>
	</div>

	<div class="feedbackItem">
		<div class="feedbackListSubtitle">
			<div class="feedbackManage">
				&nbsp;&nbsp;<span class="comment_actions"><a href="javascript:void(0);" onclick="return ReplyComment(3335456,'AcgszoHYVzzX1PuXZYgZTUoXvVDJkH7WzFIjeTeqFfTxZaWkW/UtmA==')">回复</a><a href="javascript:void(0);" onclick="return QuoteComment(3335456,'AcgszoHYVzzX1PuXZYgZTUoXvVDJkH7WzFIjeTeqFfTxZaWkW/UtmA==')">引用</a></span>
			</div>
			<a href="#3335456" class="layer">#24楼</a><a name="3335456" id="comment_anchor_3335456"></a>  <span class="comment_date">2015-12-27 11:52</span> <a id="a_comment_author_3335456" href="http://www.cnblogs.com/myidea/" target="_blank">adacn</a> <a href="http://msg.cnblogs.com/send/adacn" title="发送站内短消息" class="sendMsg2This">&nbsp;</a>
		</div>
		<div class="feedbackCon">
			<div id="comment_body_3335456" class="blog_comment_body">请问楼主是用什么软件写博客的?看起来很美观!我用的markdown。。。</div><div class="comment_vote"><a href="javascript:void(0);" class="comment_digg" onclick="return voteComment(3335456,'Digg',this)">支持(0)</a><a href="javascript:void(0);" class="comment_bury" onclick="return voteComment(3335456,'Bury',this)">反对(0)</a></div><span id="comment_3335456_avatar" style="display:none;">http://pic.cnblogs.com/face/814346/20151004154046.png</span>
		</div>
	</div>

	<div class="feedbackItem">
		<div class="feedbackListSubtitle">
			<div class="feedbackManage">
				&nbsp;&nbsp;<span class="comment_actions"><a href="javascript:void(0);" onclick="return ReplyComment(3352630,'AMK3Isb4zajPkES1rdErVMdnyTdumUDR/FwvRQ2d8sIBiBHrDJVqlg==')">回复</a><a href="javascript:void(0);" onclick="return QuoteComment(3352630,'AMK3Isb4zajPkES1rdErVMdnyTdumUDR/FwvRQ2d8sIBiBHrDJVqlg==')">引用</a></span>
			</div>
			<a href="#3352630" class="layer">#25楼</a><a name="3352630" id="comment_anchor_3352630"></a>  <span class="comment_date">2016-01-22 16:53</span> <a id="a_comment_author_3352630" href="http://www.cnblogs.com/yeayee/" target="_blank">yeayee</a> <a href="http://msg.cnblogs.com/send/yeayee" title="发送站内短消息" class="sendMsg2This">&nbsp;</a>
		</div>
		<div class="feedbackCon">
			<div id="comment_body_3352630" class="blog_comment_body">第2课已巩固www.yeayee.com</div><div class="comment_vote"><a href="javascript:void(0);" class="comment_digg" onclick="return voteComment(3352630,'Digg',this)">支持(0)</a><a href="javascript:void(0);" class="comment_bury" onclick="return voteComment(3352630,'Bury',this)">反对(0)</a></div><span id="comment_3352630_avatar" style="display:none;">http://pic.cnblogs.com/face/816924/20170922082617.png</span>
		</div>
	</div>

	<div class="feedbackItem">
		<div class="feedbackListSubtitle">
			<div class="feedbackManage">
				&nbsp;&nbsp;<span class="comment_actions"><a href="javascript:void(0);" onclick="return ReplyComment(3352633,'AMK3Isb4zajPkES1rdErVMdnyTdumUDR/FwvRQ2d8sIBiBHrDJVqlg==')">回复</a><a href="javascript:void(0);" onclick="return QuoteComment(3352633,'AMK3Isb4zajPkES1rdErVMdnyTdumUDR/FwvRQ2d8sIBiBHrDJVqlg==')">引用</a></span>
			</div>
			<a href="#3352633" class="layer">#26楼</a><a name="3352633" id="comment_anchor_3352633"></a>  <span class="comment_date">2016-01-22 16:54</span> <a id="a_comment_author_3352633" href="http://www.cnblogs.com/yeayee/" target="_blank">yeayee</a> <a href="http://msg.cnblogs.com/send/yeayee" title="发送站内短消息" class="sendMsg2This">&nbsp;</a>
		</div>
		<div class="feedbackCon">
			<div id="comment_body_3352633" class="blog_comment_body">第3课已巩固www.yeayee.com</div><div class="comment_vote"><a href="javascript:void(0);" class="comment_digg" onclick="return voteComment(3352633,'Digg',this)">支持(0)</a><a href="javascript:void(0);" class="comment_bury" onclick="return voteComment(3352633,'Bury',this)">反对(0)</a></div><span id="comment_3352633_avatar" style="display:none;">http://pic.cnblogs.com/face/816924/20170922082617.png</span>
		</div>
	</div>

	<div class="feedbackItem">
		<div class="feedbackListSubtitle">
			<div class="feedbackManage">
				&nbsp;&nbsp;<span class="comment_actions"><a href="javascript:void(0);" onclick="return ReplyComment(3393352,'UxFYQNEWvLarOn6tXauyxX+nYCLKDRa6N85Sqpm4Pw5SX8YFVICqJA==')">回复</a><a href="javascript:void(0);" onclick="return QuoteComment(3393352,'UxFYQNEWvLarOn6tXauyxX+nYCLKDRa6N85Sqpm4Pw5SX8YFVICqJA==')">引用</a></span>
			</div>
			<a href="#3393352" class="layer">#27楼</a><a name="3393352" id="comment_anchor_3393352"></a>  <span class="comment_date">2016-03-28 11:33</span> <a id="a_comment_author_3393352" href="http://home.cnblogs.com/u/922994/" target="_blank">wqh2016</a> <a href="http://msg.cnblogs.com/send/wqh2016" title="发送站内短消息" class="sendMsg2This">&nbsp;</a>
		</div>
		<div class="feedbackCon">
			<div id="comment_body_3393352" class="blog_comment_body">很好 学习了  接着学了</div><div class="comment_vote"><a href="javascript:void(0);" class="comment_digg" onclick="return voteComment(3393352,'Digg',this)">支持(0)</a><a href="javascript:void(0);" class="comment_bury" onclick="return voteComment(3393352,'Bury',this)">反对(0)</a></div>
		</div>
	</div>

	<div class="feedbackItem">
		<div class="feedbackListSubtitle">
			<div class="feedbackManage">
				&nbsp;&nbsp;<span class="comment_actions"><a href="javascript:void(0);" onclick="return ReplyComment(3450265,'CGrmmxEna7ZcRfqzQskXwgBLDAksr9Ujm0d9gq8If9Pyuz6HWW65rQ==')">回复</a><a href="javascript:void(0);" onclick="return QuoteComment(3450265,'CGrmmxEna7ZcRfqzQskXwgBLDAksr9Ujm0d9gq8If9Pyuz6HWW65rQ==')">引用</a></span>
			</div>
			<a href="#3450265" class="layer">#28楼</a><a name="3450265" id="comment_anchor_3450265"></a>  <span class="comment_date">2016-06-12 11:08</span> <a id="a_comment_author_3450265" href="http://home.cnblogs.com/u/976061/" target="_blank">y1384444</a> <a href="http://msg.cnblogs.com/send/y1384444" title="发送站内短消息" class="sendMsg2This">&nbsp;</a>
		</div>
		<div class="feedbackCon">
			<div id="comment_body_3450265" class="blog_comment_body"><a href="#2921447" title="查看所回复的评论" onclick="commentManager.renderComments(0,50,2921447);">@</a>

Vamei
$是提示符,不用输入的。
但是IDLE上面输入的,提示符都是>>>,请问怎么操作才能执行文件或者脚本,谢谢



	<div class="feedbackItem">
		<div class="feedbackListSubtitle">
			<div class="feedbackManage">
				&nbsp;&nbsp;<span class="comment_actions"><a href="javascript:void(0);" onclick="return ReplyComment(3508239,'lbPFzgt3BiR9P7kRcRz3sp7HOU3TibwDROegdboDI3IGzF8gWV7bCw==')">回复</a><a href="javascript:void(0);" onclick="return QuoteComment(3508239,'lbPFzgt3BiR9P7kRcRz3sp7HOU3TibwDROegdboDI3IGzF8gWV7bCw==')">引用</a></span>
			</div>
			<a href="#3508239" class="layer">#29楼</a><a name="3508239" id="comment_anchor_3508239"></a>  <span class="comment_date">2016-09-12 01:52</span> <a id="a_comment_author_3508239" href="http://home.cnblogs.com/u/1025049/" target="_blank">liqYpil</a> <a href="http://msg.cnblogs.com/send/liqYpil" title="发送站内短消息" class="sendMsg2This">&nbsp;</a>
		</div>
		<div class="feedbackCon">
			<div id="comment_body_3508239" class="blog_comment_body">@Vamei 作为一个从来没接触过编程的小白, 想问一下. 我当时用text document 写了 print("hello world") 但是无乱如何都打不开. 虽然很不好意思打扰你, 但的确是没有任何头绪.</div><div class="comment_vote"><a href="javascript:void(0);" class="comment_digg" onclick="return voteComment(3508239,'Digg',this)">支持(0)</a><a href="javascript:void(0);" class="comment_bury" onclick="return voteComment(3508239,'Bury',this)">反对(0)</a></div>
		</div>
	</div>

	<div class="feedbackItem">
		<div class="feedbackListSubtitle">
			<div class="feedbackManage">
				&nbsp;&nbsp;<span class="comment_actions"><a href="javascript:void(0);" onclick="return ReplyComment(3804956,'dCApL5Ni7p59hGhOhXhXuW1Rc9libZUSt1gSSdGJLTXPjzYgbJDI/Q==')">回复</a><a href="javascript:void(0);" onclick="return QuoteComment(3804956,'dCApL5Ni7p59hGhOhXhXuW1Rc9libZUSt1gSSdGJLTXPjzYgbJDI/Q==')">引用</a></span>
			</div>
			<a href="#3804956" class="layer">#30楼</a><a name="3804956" id="comment_anchor_3804956"></a><span id="comment-maxId" style="display:none;">3804956</span><span id="comment-maxDate" style="display:none;">2017/10/9 9:58:40</span>  <span class="comment_date">2017-10-09 09:58</span> <a id="a_comment_author_3804956" href="http://www.cnblogs.com/Wangr-G/" target="_blank">可爱小米兜</a> <a href="http://msg.cnblogs.com/send/%E5%8F%AF%E7%88%B1%E5%B0%8F%E7%B1%B3%E5%85%9C" title="发送站内短消息" class="sendMsg2This">&nbsp;</a>
		</div>
		<div class="feedbackCon">
			<div id="comment_body_3804956" class="blog_comment_body">感谢楼主分享</div><div class="comment_vote"><a href="javascript:void(0);" class="comment_digg" onclick="return voteComment(3804956,'Digg',this)">支持(0)</a><a href="javascript:void(0);" class="comment_bury" onclick="return voteComment(3804956,'Bury',this)">反对(0)</a></div><span id="comment_3804956_avatar" style="display:none;">http://pic.cnblogs.com/face/1165029/20170512154616.png</span>
		</div>
	</div>
<div id="comments_pager_bottom"></div></div><script type="text/javascript">var commentManager = new blogCommentManager();commentManager.renderComments(0);</script>
</div><!--end: forFlow -->
</div>
posted @ 2018-07-26 23:35  韦大仙  阅读(597)  评论(0编辑  收藏  举报