[CPS-devel] breaking code up into seperate files

Winterflood, Jonathan jonathan.winterflood at capgemini.com
Fri Mar 16 18:12:11 CET 2007


Hi all,
 
I have a number of .py files in my product that need to use the same set of functions; So far i've been resorting to copy/paste to make them work...
 
Obviously this isn't a good idea, so i created a file containing (so far) one function
this file is placed at the root of my product, and is organised as such:
 
""" my file's comment
"""
 
def myfunc():
    """myfunc's comment
    """
    etc...
 
EOF(myfile.py)
 
To use this, I'm trying to import it in the .py that's using it:
from myfile import myfunc
 
This gives me a traceback whenever I try to use it...:
ImportError: import of "csv_render" is unauthorized
 
What should I do to allow the import?
 
TIA,
Jonathan


This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient,  you are not authorized to read, print, retain, copy, disseminate,  distribute, or use this message or any part thereof. If you receive this  message in error, please notify the sender immediately and delete all  copies of this message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.nuxeo.com/pipermail/cps-devel/attachments/20070316/2132cbff/attachment.htm



This list archive provided by Nuxeo, the leaders of open source ECM. Check out the Nuxeo 5 open source, standards-based ECM project.