Could somebody please explain what is happening ....

John Dean john at
Mon Sep 15 18:09:09 CEST 2003

John Dean wrote:

> Hi
> I have been reading quite a lot of Python source code recently and I have
> come across a particular construct which I don't understand. I would be
> grateful if somebody could explain the reason for including the following
> lines of code. I have seen it only at the beginning of a module:-
> global sys
> import sys
> global os
> import os
> ....
> ....
> I know what global means and I know what import means but what is the
> reason for making an imported module global?
Thank you to all who posted an answer. I was begining to think I was going
nuts or something. Even though I am new to Python I knew something was

Best Regards

More information about the Python-list mailing list