As I mentioned earlier this script when saved and then imported as a module was not able to print out the desired object names, I apologize if I was not clear at first instant. The script works fine if one will execute this in the Maya script editor, however it does not print out the window and the polygon objects on the screen when imported as module.
Okay, I figured out later that this was due to the fact that temp_var and a_window variables were not getting updated in the global namespace, as you mentioned that their scope remains local to that function.
A weird case though was, when I called a function with a single argument it got printed ok.
Anyways, with all that said and done, Achayan introduced me to the wonderful function wrapper modules called functools ,it has a nice function called partial.
here is a working sample of the code:
This way of creating a module makes the process way more safer by avoiding hassle of managing global variables in the program.
from functools import partial
maya.cmds.button(label="call_aFunc",align="center",command = partial(a_calledFunc,temp_var, a_Window))
def a_calledFunc(arg00,arg01, part):