<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.scott5.org/index.php?action=history&amp;feed=atom&amp;title=Python_Modules</id>
	<title>Python Modules - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.scott5.org/index.php?action=history&amp;feed=atom&amp;title=Python_Modules"/>
	<link rel="alternate" type="text/html" href="https://wiki.scott5.org/index.php?title=Python_Modules&amp;action=history"/>
	<updated>2026-04-14T13:58:28Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://wiki.scott5.org/index.php?title=Python_Modules&amp;diff=230&amp;oldid=prev</id>
		<title>Scott: Created page with &#039;== Search Path == An &lt;code&gt;import&lt;/code&gt; statement refers to python files without any path or extension information. To import &lt;code&gt;C:\work\test\my_test.py&lt;/code&gt;, you would jus…&#039;</title>
		<link rel="alternate" type="text/html" href="https://wiki.scott5.org/index.php?title=Python_Modules&amp;diff=230&amp;oldid=prev"/>
		<updated>2011-02-01T22:21:22Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;#039;== Search Path == An &amp;lt;code&amp;gt;import&amp;lt;/code&amp;gt; statement refers to python files without any path or extension information. To import &amp;lt;code&amp;gt;C:\work\test\my_test.py&amp;lt;/code&amp;gt;, you would jus…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Search Path ==&lt;br /&gt;
An &amp;lt;code&amp;gt;import&amp;lt;/code&amp;gt; statement refers to python files without any path or extension information. To import &amp;lt;code&amp;gt;C:\work\test\my_test.py&amp;lt;/code&amp;gt;, you would just type&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import my_test&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The interpreter searches in the following locations:&lt;br /&gt;
# The current directory.&lt;br /&gt;
# The PYTHONPATH variable.&lt;br /&gt;
# The standard library &lt;br /&gt;
&lt;br /&gt;
== Importing ==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import time&lt;br /&gt;
x = time.localtime()&lt;br /&gt;
from time import localtime&lt;br /&gt;
x = localtime()&lt;br /&gt;
from time import *&lt;br /&gt;
x = localtime()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Code ==&lt;br /&gt;
Everything in a module file gets executed when the module is first imported. Test code should run only when you explicitly run the module file itself. &lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
if __name__ == &amp;#039;__main__&amp;#039;:&lt;br /&gt;
    # run test code&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
	</entry>
</feed>