discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] GRC Importing modules from local directory


From: adeel anwar
Subject: Re: [Discuss-gnuradio] GRC Importing modules from local directory
Date: Thu, 6 Oct 2011 02:02:55 -0700

While writing python programs we can import any module from same directory directly (no need to put it in python path)
e.g. in "gnuradio-examples>digital>benchmark_loopback.py" 2 modules transmit_path and receive_path are imported.
Even if we copy this "digital" to some other place e.g. desktop, these files will still be imported without error.
Can't we do same in GRC?
As u told by putting these modules in python path we can import in GRC but if i write an  example and wants to distribute,
it should be able to run in any directory as it is without the requirement to put in python path (e.g. digital mentioned above)

Adeel

On Wed, Oct 5, 2011 at 11:55 PM, Josh Blum <address@hidden> wrote:


On 10/05/2011 11:50 PM, adeel anwar wrote:
> Using GRC "import block", i want to import some custom modules from a local
> directory
> (same directory contains grc files and other files that needs to be
> imported), but it is giving error.
> As i understood, GRC doesn't recognizes the directory in which we save
> '*.grc' as its working directory
> How can i import these modules?
>
>   Regards
>          Adeel
>
>

As with all things python. Put the modules in your PYTHONPATH. If you
can import the module from a python shell, it will work in GRC.

-josh

_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


reply via email to

[Prev in Thread] Current Thread [Next in Thread]