Re: Help needed - function apparently global cannot be called.

2010-09-07 Thread Ian
Hi Rami, Stefan, Bruno. First a big thanks for your replies. On 07/09/2010 20:54, Rami Chowdhury wrote: Hi Ian, I think I see where you're going wrong -- this bit me too when I was learning Python, having come from PHP. Unlike PHP, when you import a module in Python it does *not* inherit th

Re: Help needed - function apparently global cannot be called.

2010-09-07 Thread Stefan Schwarzer
Hi Ian, On 2010-09-07 12:18, Ian Hobson wrote: > f = open('d:\logfile.txt','a') Just a note: Using a backslash in a non-raw string will get you in trouble as soon as the backslash is followed by a character which makes a special character sequence, like "\n". For example, f = open('d:\nice_

Re: Help needed - function apparently global cannot be called.

2010-09-07 Thread Rami Chowdhury
Hi Ian, On Tue, Sep 7, 2010 at 20:00, Ian wrote: > On 07/09/2010 11:50, Bruno Desthuilliers wrote: > > note the order of the above - log is defined before the import. > > And ? Do you think it will affect the imported module in any way ? Like, > say, magically "inject" your log function in the

Re: Help needed - function apparently global cannot be called.

2010-09-07 Thread Ian
Hi Bruno, Thanks for your quick response. I still do not understand. On 07/09/2010 11:50, Bruno Desthuilliers wrote: Ian Hobson a écrit : Hi all you experts, This has me beat. Has anyone any ideas about what might be going wrong? This is code from within a windows service (hence no print s

Re: Help needed - function apparently global cannot be called.

2010-09-07 Thread Bruno Desthuilliers
Ian Hobson a écrit : (snip) you may also want to read the recent "using modules" thread... -- http://mail.python.org/mailman/listinfo/python-list

Re: Help needed - function apparently global cannot be called.

2010-09-07 Thread Bruno Desthuilliers
Ian Hobson a écrit : Hi all you experts, This has me beat. Has anyone any ideas about what might be going wrong? This is code from within a windows service (hence no print statements - no sys.stdout to print on!). I am trying to trace through to find where the code is not working. No stdout

Help needed - function apparently global cannot be called.

2010-09-07 Thread Ian Hobson
Hi all you experts, This has me beat. Has anyone any ideas about what might be going wrong? This is code from within a windows service (hence no print statements - no sys.stdout to print on!). I am trying to trace through to find where the code is not working. No stdout so I have to log to a