[nengo-user] Importing User-Defined Modules

Xuan Choo fchoo at cs.uwaterloo.ca
Mon Jul 21 14:49:08 EDT 2014


Hi Brian,

(Once again, using the proper email address this time)
Just as in Python, you can use "sys" to append paths to the python system
paths (so that python can find user modules).

Usage:

import sys
sys.path.append('Path_to_external_module')

import external_module

Cheers,


-------------------------
Xuan Choo
PhD Candidate
Computational Neuroscience Research Group
Centre for Theoretical Neuroscience, University of Waterloo
Tel: (519) 888 4567 ext: 38842
HP: (226) 339 3892
Office: PAS 2462


On Mon, Jul 21, 2014 at 2:47 PM, Xuan Choo <xchoo.mainframe at gmail.com>
wrote:

> Hi Brian,
>
> Just as in Python, you can use "sys" to append paths to the python system
> paths (so that python can find user modules).
>
> Usage:
>
> import sys
> sys.path.append('Path_to_external_module')
>
> import external_module
>
> Cheers,
>
>
> -------------------------
> Xuan Choo
> HP: (226) 339 3892
>
>
> On Mon, Jul 21, 2014 at 1:51 PM, Brian Krainer <bkrainer731 at gmail.com>
> wrote:
>
>> Hello,
>>
>> As I'm sure you know, Python allows users to import other .py files and
>> use functions from those imported files. Is there any way to import my own
>> files in the .py file with the Nengo network? I've been trying to do this
>> but I've been having some difficulties.
>>
>> Thanks,
>>
>> Brian
>>
>> _______________________________________________
>> nengo-user mailing list
>> nengo-user at ctnsrv.uwaterloo.ca
>> http://ctnsrv.uwaterloo.ca/mailman/listinfo/nengo-user
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://artsservices.uwaterloo.ca/pipermail/nengo-user/attachments/20140721/ef068368/attachment-0002.html>


More information about the nengo-user mailing list