<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://modiki.civfanatics.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Duha</id>
	<title>Civilization Modding Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://modiki.civfanatics.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Duha"/>
	<link rel="alternate" type="text/html" href="https://modiki.civfanatics.com/index.php/Special:Contributions/Duha"/>
	<updated>2026-04-11T19:36:25Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://modiki.civfanatics.com/index.php?title=Civ4_Python&amp;diff=4577</id>
		<title>Civ4 Python</title>
		<link rel="alternate" type="text/html" href="https://modiki.civfanatics.com/index.php?title=Civ4_Python&amp;diff=4577"/>
		<updated>2010-07-17T12:57:32Z</updated>

		<summary type="html">&lt;p&gt;Duha: /* Tutorials and Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Template ==&lt;br /&gt;
Please use the following template for python files.&lt;br /&gt;
* [[Format for new Python pages]]&lt;br /&gt;
&lt;br /&gt;
== Tutorials and Reference ==&lt;br /&gt;
&lt;br /&gt;
* [http://forums.civfanatics.com/showthread.php?t=154130 TGA&#039;s Python Tutorial]&lt;br /&gt;
* [http://forums.civfanatics.com/showthread.php?t=163848 How to Call a Function at the End of a Turn]&lt;br /&gt;
* [http://apolyton.net/forums/showthread.php?s=&amp;amp;threadid=167960 Jon Shafer&#039;s Guide to Python in Civ4]&lt;br /&gt;
* [http://forums.civfanatics.com/showthread.php?t=152856 Sample Python Code]&lt;br /&gt;
* BTS Python API&lt;br /&gt;
** [http://civ4bug.sourceforge.net/PythonAPI/index.html View]&lt;br /&gt;
** [http://code.google.com/p/civ4-python-api/ Project @ Google Code]&lt;br /&gt;
** [http://forums.civfanatics.com/showthread.php?t=238839 Forum Discussion]&lt;br /&gt;
* [http://civilization4.net/files/modding/PythonAPI/ Warlords Python API]&lt;br /&gt;
* [http://forums.civfanatics.com/showthread.php?t=323805 Modding CvGameUtils]&lt;br /&gt;
* [http://forums.civfanatics.com/showthread.php?t=331001 How to Make Python Action Buttons]&lt;br /&gt;
* [http://modiki.civfanatics.com/index.php/Civ4_Python/import Import guide]&lt;br /&gt;
&lt;br /&gt;
== Files ==&lt;br /&gt;
&lt;br /&gt;
=== Assets\Python ===&lt;br /&gt;
* [[CvAdvisorUtils]]&lt;br /&gt;
* [[CvCameraControls]]&lt;br /&gt;
* [[CvDebugTools]]&lt;br /&gt;
* [[CvDefineEditor]]&lt;br /&gt;
* [[CvDiplomacy]]&lt;br /&gt;
* [[CvEventManager]]&lt;br /&gt;
* [[CvGameUtils]]&lt;br /&gt;
* [[CvMagGeneratorUtil]]&lt;br /&gt;
* [[CvPerfTest]]&lt;br /&gt;
* [[CvQuestManager]]&lt;br /&gt;
* [[CvScreenUtils]]&lt;br /&gt;
* [[CvUtil]]&lt;br /&gt;
* [[DomPyHelpers]]&lt;br /&gt;
* [[PyHelpers]]&lt;br /&gt;
* [[ScreenImput]]&lt;br /&gt;
* [[vector]]&lt;br /&gt;
&lt;br /&gt;
=== Assets\Python\_DebugTools ===&lt;br /&gt;
* [[AudioLogParser]]&lt;br /&gt;
&lt;br /&gt;
=== Assets\Python\EntryPoints ===&lt;br /&gt;
* [[CvAppInterface]]&lt;br /&gt;
* [[CvDebugInterface]]&lt;br /&gt;
* [[CvDiplomacyInterface]]&lt;br /&gt;
* [[CvEventInterface]]&lt;br /&gt;
* [[CvGameInterface]]&lt;br /&gt;
* [[CvGameInterfaceFile]]&lt;br /&gt;
* [[CvMapScriptInterface]]&lt;br /&gt;
* [[CvOptionScreenCallbackInterface]]&lt;br /&gt;
* [[CvPopupInterface]]&lt;br /&gt;
* [[CvRandomEventInterface]]&lt;br /&gt;
* [[CvScreensInterface]]&lt;br /&gt;
* [[CvScreenUtilsInterface]]&lt;br /&gt;
* [[CvTranslator]]&lt;br /&gt;
* [[CvUnitControlInterface]]&lt;br /&gt;
* [[CvWBInterface]]&lt;br /&gt;
* [[PbMain]]&lt;br /&gt;
&lt;br /&gt;
=== Assets\Python\PitBoss ===&lt;br /&gt;
* [[PbAdmin]]&lt;br /&gt;
* [[PbWizard]]&lt;br /&gt;
&lt;br /&gt;
=== Assets\Python\pyHelper ===&lt;br /&gt;
* [[Popup]]&lt;br /&gt;
* [[Unit]]&lt;br /&gt;
* [[UnitEntity]]&lt;br /&gt;
&lt;br /&gt;
=== Assets\Python\pyUnit ===&lt;br /&gt;
* [[CvUnitController]]&lt;br /&gt;
&lt;br /&gt;
=== Assets\Python\pyWB ===&lt;br /&gt;
* [[CvWBDesc]]&lt;br /&gt;
* [[CvWBPopups]]&lt;br /&gt;
&lt;br /&gt;
=== Assets\Python\Screens ===&lt;br /&gt;
* [[CvAdvisorScreen]]&lt;br /&gt;
* [[CvCivicsScreen]]&lt;br /&gt;
* [[CvCorporationAdvisor]]&lt;br /&gt;
* [[CvDanQuayle]]&lt;br /&gt;
* [[CvDawnOfMan]]&lt;br /&gt;
* [[CvDebugInfoScreen]]&lt;br /&gt;
* [[CvDomesticAdvisor]]&lt;br /&gt;
* [[CvEraMovieScreen]]&lt;br /&gt;
* [[CvEspionageAdvisor]]&lt;br /&gt;
* [[CvExoticForeignAdvisor]]&lt;br /&gt;
* [[CvFinanceAdvisor]]&lt;br /&gt;
* [[CvForeignAdvisor]]&lt;br /&gt;
* [[CvGFCScreen]]&lt;br /&gt;
* [[CvHallOfFameScreen]]&lt;br /&gt;
* [[CvInfoScreen]]&lt;br /&gt;
* [[CvIntroMovieScreen]]&lt;br /&gt;
* [[CvMainInterface]]&lt;br /&gt;
* [[CvMilitaryAdvisor]]&lt;br /&gt;
* [[CvOptionsScreen]]&lt;br /&gt;
* [[CvPediaBonus]]&lt;br /&gt;
* [[CvPediaBuilding]]&lt;br /&gt;
* [[CvPediaCivic]]&lt;br /&gt;
* [[CvPediaCivilization]]&lt;br /&gt;
* [[CvPediaCorporation]]&lt;br /&gt;
* [[CvPediaFeature]]&lt;br /&gt;
* [[CvPediaHistory]]&lt;br /&gt;
* [[CvPediaImprovement]]&lt;br /&gt;
* [[CvPediaLeader]]&lt;br /&gt;
* [[CvPediaMain]]&lt;br /&gt;
* [[CvPediaProject]]&lt;br /&gt;
* [[CvPediaPromotion]]&lt;br /&gt;
* [[CvPediaReligion]]&lt;br /&gt;
* [[CvPediaScreen]]&lt;br /&gt;
* [[CvPediaSpecialist]]&lt;br /&gt;
* [[CvPediaTech]]&lt;br /&gt;
* [[CvPediaTerrain]]&lt;br /&gt;
* [[CvPediaUnit]]&lt;br /&gt;
* [[CvPediaUnitChart]]&lt;br /&gt;
* [[CvReligionScreen]]&lt;br /&gt;
* [[CvReplayScreen]]&lt;br /&gt;
* [[CvScreen]]&lt;br /&gt;
* [[CvScreenEnums]]&lt;br /&gt;
* [[CvSpaceShipScreen]]&lt;br /&gt;
* [[CvTechChooser]]&lt;br /&gt;
* [[CvTechSplashScreen]]&lt;br /&gt;
* [[CvTopCivs]]&lt;br /&gt;
* [[CvTutorialQuestScreen]]&lt;br /&gt;
* [[CvUNVictoryScreen]]&lt;br /&gt;
* [[CvVictoryMovieScreen]]&lt;br /&gt;
* [[CvVictoryScreen]]&lt;br /&gt;
* [[CvWonderMovieScreen]]&lt;br /&gt;
* [[CvWorldBuilderDiplomacyScreen]]&lt;br /&gt;
* [[CvWorldBuilderScreen]]&lt;br /&gt;
* [[IconGrid]]&lt;br /&gt;
* [[TechTree]]&lt;br /&gt;
&lt;br /&gt;
=== Assets\Python\System ===&lt;br /&gt;
* These files are mostly compiled python files that cannot be modified.&lt;br /&gt;
&lt;br /&gt;
{{Civ4_Python_Files}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Civilization 4]]&lt;/div&gt;</summary>
		<author><name>Duha</name></author>
	</entry>
	<entry>
		<id>https://modiki.civfanatics.com/index.php?title=Civ4_Python/import&amp;diff=4576</id>
		<title>Civ4 Python/import</title>
		<link rel="alternate" type="text/html" href="https://modiki.civfanatics.com/index.php?title=Civ4_Python/import&amp;diff=4576"/>
		<updated>2010-07-17T12:55:54Z</updated>

		<summary type="html">&lt;p&gt;Duha: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Import guide.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
import allow you to add python files to you mod.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
How to add popup to the event:&lt;br /&gt;
:&#039;&#039;&#039;Bad way:&#039;&#039;&#039; &lt;br /&gt;
* Insert popup code to CvEventManager.py in event.&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Result:&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Big files is hard to read and edit. It is not easy to customize this code and merge to others mod.&amp;lt;br /&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;Good way:&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
* Create file mymod.py&amp;lt;br /&amp;gt;&lt;br /&gt;
* Create function that runs popup (for example: run_popup)&amp;lt;br /&amp;gt;&lt;br /&gt;
* edit CvEventManager.py:&amp;lt;br /&amp;gt;&lt;br /&gt;
** add string after imports: import mymod.py&amp;lt;br /&amp;gt;&lt;br /&gt;
** and string in event: mymod.run_popup(*args)&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Result:&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
It is easy to add / remove this function from mod (just uncomment lines).&amp;lt;br /&amp;gt;&lt;br /&gt;
It is easy to share this function. &amp;lt;br /&amp;gt;&lt;br /&gt;
It is easy to call this function in other place. (if yon need it on some event).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
import executes script in file (if you have only functions and classes loads them to memory.)&lt;br /&gt;
&lt;br /&gt;
==&#039;&#039;&#039;import sintax:&#039;&#039;&#039;==&lt;br /&gt;
* &#039;&#039;import mymod&#039;&#039;&amp;lt;br /&amp;gt; &lt;br /&gt;
to access functions use:&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;mymod.foo()&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;from mymod import *&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
to access functions use: &amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;foo()&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;from mymod import foo, goo&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
to access functions use: &amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;foo()&#039;&#039; or &#039;&#039;goo()&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
(some IDE has autocomplite feature and in this way shows only foo and goo.)&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;from mymod import this_is_long_name_function as foo&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
to access functions use:&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;foo()&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
(It is good idea to have functions with understandable name)&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Import folders&#039;&#039;&#039; ==&lt;br /&gt;
* Create folder (mymodule)&lt;br /&gt;
* Create __init__.py (leave it blank)&lt;br /&gt;
* Create file: myscript.py&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Usage&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
from mymodule import myscript &amp;lt;br /&amp;gt;&lt;br /&gt;
or&amp;lt;br /&amp;gt;&lt;br /&gt;
from mymodule.myscript import *&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==&#039;&#039;&#039;Import rules:&#039;&#039;&#039;==&lt;br /&gt;
Use imports at the file beginning!&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
[http://forums.civfanatics.com/showpost.php?p=2495872 Lesson 09 - &#039;Borrowing&#039; other people&#039;s stuff (with modules)]&lt;/div&gt;</summary>
		<author><name>Duha</name></author>
	</entry>
	<entry>
		<id>https://modiki.civfanatics.com/index.php?title=Civ4_Python/import&amp;diff=4575</id>
		<title>Civ4 Python/import</title>
		<link rel="alternate" type="text/html" href="https://modiki.civfanatics.com/index.php?title=Civ4_Python/import&amp;diff=4575"/>
		<updated>2010-07-17T12:39:02Z</updated>

		<summary type="html">&lt;p&gt;Duha: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;import allow you to add python files to you mod.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
How to add popup to the event:&lt;br /&gt;
:&#039;&#039;&#039;Bad way:&#039;&#039;&#039; &lt;br /&gt;
* Insert popup code to CvEventManager.py in event.&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Result:&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Big files is hard to read and edit. It is not easy to customize this code and merge to others mod.&amp;lt;br /&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;Good way:&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
* Create file mymod.py&amp;lt;br /&amp;gt;&lt;br /&gt;
* Create function that runs popup (for example: run_popup)&amp;lt;br /&amp;gt;&lt;br /&gt;
* edit CvEventManager.py:&amp;lt;br /&amp;gt;&lt;br /&gt;
** add string after imports: import mymod.py&amp;lt;br /&amp;gt;&lt;br /&gt;
** and string in event: mymod.run_popup(*args)&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Result:&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
It is easy to add / remove this function from mod (just uncomment lines).&amp;lt;br /&amp;gt;&lt;br /&gt;
It is easy to share this function. &amp;lt;br /&amp;gt;&lt;br /&gt;
It is easy to call this function in other place. (if yon need it on some event).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
import executes script in file (if you have only functions and classes loads them to memory.)&lt;br /&gt;
&lt;br /&gt;
==&#039;&#039;&#039;import sintax:&#039;&#039;&#039;==&lt;br /&gt;
* &#039;&#039;import mymod&#039;&#039;&amp;lt;br /&amp;gt; &lt;br /&gt;
to access functions use:&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;mymod.foo()&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;from mymod import *&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
to access functions use: &amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;foo()&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;from mymod import foo, goo&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
to access functions use: &amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;foo()&#039;&#039; or &#039;&#039;goo()&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
(some IDE has autocomplite feature and in this way shows only foo and goo.)&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;from mymod import this_is_long_name_function as foo&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
to access functions use:&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;foo()&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
(It is good idea to have functions with understandable name)&lt;br /&gt;
&lt;br /&gt;
==&#039;&#039;&#039;Import rules:&#039;&#039;&#039;==&lt;br /&gt;
Use imports at the file beginning!&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
[http://forums.civfanatics.com/showpost.php?p=2495872|Lesson 09 - &#039;Borrowing&#039; other people&#039;s stuff (with modules)]&lt;/div&gt;</summary>
		<author><name>Duha</name></author>
	</entry>
	<entry>
		<id>https://modiki.civfanatics.com/index.php?title=Civ4_Python/import&amp;diff=4574</id>
		<title>Civ4 Python/import</title>
		<link rel="alternate" type="text/html" href="https://modiki.civfanatics.com/index.php?title=Civ4_Python/import&amp;diff=4574"/>
		<updated>2010-07-17T12:21:09Z</updated>

		<summary type="html">&lt;p&gt;Duha: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;import allow you to add python files to you mod.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
How to add popup to the event:&lt;br /&gt;
:&#039;&#039;&#039;Bad way:&#039;&#039;&#039; &lt;br /&gt;
* Insert popup code to CvEventManager.py in event.&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Result:&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Big files is hard to read and edit. It is not easy to customize this code and merge to others mod.&amp;lt;br /&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;Good way:&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
* Create file mymod.py&amp;lt;br /&amp;gt;&lt;br /&gt;
* Create function that runs popup (for example: run_popup)&amp;lt;br /&amp;gt;&lt;br /&gt;
* edit CvEventManager.py:&amp;lt;br /&amp;gt;&lt;br /&gt;
** add string after imports: import mymod.py&amp;lt;br /&amp;gt;&lt;br /&gt;
** and string in event: mymod.run_popup(*args)&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Result:&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
It is easy to add / remove this function from mod (just uncomment lines).&amp;lt;br /&amp;gt;&lt;br /&gt;
It is easy to share this function. &amp;lt;br /&amp;gt;&lt;br /&gt;
It is easy to call this function in other place. (if yon need it on some event).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
import executes script in file (if you have only functions and classes loads them to memory.)&lt;br /&gt;
&lt;br /&gt;
==&#039;&#039;&#039;import sintax:&#039;&#039;&#039;==&lt;br /&gt;
* &#039;&#039;import mymod&#039;&#039;&amp;lt;br /&amp;gt; &lt;br /&gt;
to access functions use:&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;mymod.foo()&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;from mymod import *&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
to access functions use: &amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;foo()&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;from mymod import foo, goo&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
to access functions use: &amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;foo()&#039;&#039; or &#039;&#039;goo()&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
(some IDE has autocomplite feature and in this way shows only foo and goo.)&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;from mymod import this_is_long_name_function as foo&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
to access functions use:&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;foo()&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
(It is good idea to have functions with understandable name)&lt;br /&gt;
&lt;br /&gt;
==&#039;&#039;&#039;Import rules:&#039;&#039;&#039;==&lt;br /&gt;
Use imports at the file beginning!&lt;/div&gt;</summary>
		<author><name>Duha</name></author>
	</entry>
	<entry>
		<id>https://modiki.civfanatics.com/index.php?title=Civ4_Python/import&amp;diff=4573</id>
		<title>Civ4 Python/import</title>
		<link rel="alternate" type="text/html" href="https://modiki.civfanatics.com/index.php?title=Civ4_Python/import&amp;diff=4573"/>
		<updated>2010-07-17T10:03:45Z</updated>

		<summary type="html">&lt;p&gt;Duha: Created page with &amp;#039;import allow you to add python files to you mod.  Example:  adding popup to the start of turn:  &amp;#039;&amp;#039;&amp;#039;Bad way:&amp;#039;&amp;#039;&amp;#039;  Insert popup code to CvEventManager.py  Big files is hard to read....&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;import allow you to add python files to you mod.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
adding popup to the start of turn:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Bad way:&#039;&#039;&#039; &lt;br /&gt;
Insert popup code to CvEventManager.py&lt;br /&gt;
&lt;br /&gt;
Big files is hard to read. It is not easy to customize this code and merge to others mod.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;good way&#039;&#039;&#039;&lt;br /&gt;
Create file mymod.py&lt;br /&gt;
Create function that runs popup (run_popup)&lt;br /&gt;
edit CvEventManager.py:&lt;br /&gt;
&lt;br /&gt;
add string after imports:&lt;br /&gt;
import mymod.py&lt;br /&gt;
&lt;br /&gt;
and string: &lt;br /&gt;
mymod.run_popup() there it needs.&lt;br /&gt;
&lt;br /&gt;
It is easy to add / remove this function (just uncomment lines)&lt;br /&gt;
It is easy to share.&lt;br /&gt;
It is easy to call this function in other place.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;import sintax:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
import executes file (if you have only functions and classes loads them to memory.)&lt;br /&gt;
&lt;br /&gt;
import mymod &lt;br /&gt;
to access functions use: mymod.foo()&lt;br /&gt;
&lt;br /&gt;
from mymod import *&lt;br /&gt;
to access functions use: foo()&lt;br /&gt;
&lt;br /&gt;
from mymod import foo, goo&lt;br /&gt;
to access functions use: foo()&lt;br /&gt;
(some IDE has autocomplite feature and in this way shows only foo and goo. if you don use IDE  use *)&lt;br /&gt;
&lt;br /&gt;
from mymod import this_is_long_name_function as foo&lt;br /&gt;
to access functions us: foo()&lt;br /&gt;
(It is good idea to have functions with understandable name)&lt;br /&gt;
&lt;br /&gt;
Import rules:&lt;br /&gt;
Use imports at the file beginning.&lt;/div&gt;</summary>
		<author><name>Duha</name></author>
	</entry>
</feed>