In python 2.x, dividing two integers returns an integer. However, if you use
from ___future___ import division
you can get a float value:>
import statements are local to the file you import in, so for example, if you have this file as example.py:
from __future__ import division
print(1/2)
Then you load it in another file:
import example # prints 0.5 because `division` is imported in example.py
print(1/2) # prints 0 because `division` is not imported in this file
So if you want an import that's only used in some of your code, put that code in a separate file.
In the case you gave, I'm not sure it's helpful though. Why not just use // when you need integer division?