<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>http://202.127.29.3/~shen/wiki/index.php?action=history&amp;feed=atom&amp;title=%E8%84%9A%E6%9C%AC%E5%92%8C%E6%A8%A1%E5%9D%97</id>
	<title>脚本和模块 - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="http://202.127.29.3/~shen/wiki/index.php?action=history&amp;feed=atom&amp;title=%E8%84%9A%E6%9C%AC%E5%92%8C%E6%A8%A1%E5%9D%97"/>
	<link rel="alternate" type="text/html" href="http://202.127.29.3/~shen/wiki/index.php?title=%E8%84%9A%E6%9C%AC%E5%92%8C%E6%A8%A1%E5%9D%97&amp;action=history"/>
	<updated>2026-05-13T05:45:39Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.38.1</generator>
	<entry>
		<id>http://202.127.29.3/~shen/wiki/index.php?title=%E8%84%9A%E6%9C%AC%E5%92%8C%E6%A8%A1%E5%9D%97&amp;diff=2707&amp;oldid=prev</id>
		<title>Shen：​创建页面，内容为“*模块不能直接运行 *脚本可以 *参考http://blog.csdn.net/kenkywu/article/details/6743462  创建一个test.py  def test2():     print &quot;test2 is running&quot;...”</title>
		<link rel="alternate" type="text/html" href="http://202.127.29.3/~shen/wiki/index.php?title=%E8%84%9A%E6%9C%AC%E5%92%8C%E6%A8%A1%E5%9D%97&amp;diff=2707&amp;oldid=prev"/>
		<updated>2017-09-08T09:50:30Z</updated>

		<summary type="html">&lt;p&gt;创建页面，内容为“*模块不能直接运行 *脚本可以 *参考http://blog.csdn.net/kenkywu/article/details/6743462  创建一个test.py  def test2():     print &amp;quot;test2 is running&amp;quot;...”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;*模块不能直接运行&lt;br /&gt;
*脚本可以&lt;br /&gt;
*参考http://blog.csdn.net/kenkywu/article/details/6743462&lt;br /&gt;
&lt;br /&gt;
创建一个test.py&lt;br /&gt;
 def test2():&lt;br /&gt;
    print &amp;quot;test2 is running&amp;quot;&lt;br /&gt;
 if __name__ == &amp;quot;__main__&amp;quot;:#自运行时调用该程序块&lt;br /&gt;
    print &amp;quot;test main is working&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 if __name__ == &amp;quot;test&amp;quot;:#import时调用该程序块&lt;br /&gt;
    print &amp;quot;test is invoked&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt;python test.py&lt;br /&gt;
test main is working&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt;import test&lt;br /&gt;
test is invoked&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; test.test2()&lt;br /&gt;
 print &amp;quot;test2 is running&amp;quot;&lt;/div&gt;</summary>
		<author><name>Shen</name></author>
	</entry>
</feed>