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 <j...@joshknows.com> 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 > Discuss-gnuradio@gnu.org > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio >
_______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio