<p>I have a file that I want to include in Python but the included file is fairly long and it'd be much neater to be able to split them into several files but then I have to use several include statements.</p>

<p>Is there some way to group together several files and include them all at once?</p>

[{'answer_id': 53036, 'author': 'readonly', 'author_id': 4883, 'author_profile': 'https://Stackoverflow.com/users/4883', 'pm_score': 3, 'selected': False, 'text': '<p>Yes, take a look at the "6.4 Packages" section in <a href="http://docs.python.org/tut/node8.html" rel="nofollow noreferrer">http://docs.python.org/tut/node8.html</a>:</p>\n\n<p>Basically, you can place a bunch of files into a directory and add an __init__.py file to the directory.  If the directory is in your PYTHONPATH or sys.path, you can do "import directoryname" to import everything in the directory or "import directoryname.some_file_in_directory" to import a specific file that is in the directory.</p>\n\n<blockquote>\n  <p>The __init__.py files are required to make Python treat the directories as containing packages; this is done to prevent directories with a common name, such as "string", from unintentionally hiding valid modules that occur later on the module search path. In the simplest case, __init__.py can just be an empty file, but it can also execute initialization code for the package or set the __all__ variable, described later. </p>\n</blockquote>\n'}, {'answer_id': 53037, 'author': 'jfs', 'author_id': 4279, 'author_profile': 'https://Stackoverflow.com/users/4279', 'pm_score': 4, 'selected': True, 'text': '<ol>\n<li>Put files in one folder. </li>\n<li>Add &#95;&#95;init&#95;&#95;.py file to the folder. Do necessary imports in &#95;&#95;init&#95;&#95;.py</li>\n<li><p>Replace multiple imports by one:</p>\n\n<p>import folder_name  </p></li>\n</ol>\n\n<p>See <a href="http://docs.python.org/tut/node8.html#SECTION008400000000000000000" rel="nofollow noreferrer">Python Package Management</a></p>\n'}]
['https://Stackoverflow.com/questions/53027', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1384652/']