On Thu, Dec 17, 2015 at 3:09 AM, Ganesh Pal <ganesh1...@gmail.com> wrote: > Iam on python 2.7 and linux .I need to know if we need to place the > modules in a particular or it doesn't matter at all > > order while writing the program > > For Example > > import os > import shlex > import subprocess > import time > import sys > import logging > import plaftform.cluster > from util import run
The order of the import statements is the order the modules will get loaded up. As a general rule this won't matter; when it comes to standard library modules, you can generally assume that you can put them in any order without it making any difference. It's common to order them in some aesthetically-pleasing way (maybe alphabetical order, or maybe sort them by the length of the name - whatever you like). There is a broad convention that standard library modules get imported first, and modules that are part of the current project get imported afterwards. But even that doesn't usually matter very much. ChrisA -- https://mail.python.org/mailman/listinfo/python-list