RingZzer0
11-24-2011, 05:13 AM
Hi,
I am new to python coding and aware of following ways of importing modules (sys in my case):
1. import sys
All methods/functions of sys would get imported and the way of accessing them would be - sys.version
2. from sys import *
All methods/functions of sys would get imported and the way of accessing them would be - version
3. from sys import version
Just the method 'version' would get imported and the way of accessing it would be - version
Further, I think the best way to avoid collisions is to use the way 1 so that method/function could be associated with module name (sys.version) and collision could be avoided with other local or user methods.
Is my perception clear about importing and using them? Or are there more ways of doing it?
Thanks
I am new to python coding and aware of following ways of importing modules (sys in my case):
1. import sys
All methods/functions of sys would get imported and the way of accessing them would be - sys.version
2. from sys import *
All methods/functions of sys would get imported and the way of accessing them would be - version
3. from sys import version
Just the method 'version' would get imported and the way of accessing it would be - version
Further, I think the best way to avoid collisions is to use the way 1 so that method/function could be associated with module name (sys.version) and collision could be avoided with other local or user methods.
Is my perception clear about importing and using them? Or are there more ways of doing it?
Thanks