Import: Difference between revisions
Jump to navigation
Jump to search
(Created page with "Category:Block Docs Category:Stub Docs This is the template for the "Page-per-block Docs". This first section should describe what the block...") |
(add explanation of paths for import) |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
[[Category:Block Docs]] | [[Category:Block Docs]] | ||
Import additional python modules into the namespace. | |||
;Examples: | |||
:* from gnuradio.filter import firdes | |||
:* import math,cmath | |||
:* from math import pi | |||
== Parameters == | == Parameters == | ||
; | ; Import | ||
: | : Takes the import string as input e.g. ("import math"). Python will attempt to import from whatever directory the current .grc file is in, the default system paths, and whatever is in $PYTHONPATH. You can not specify other paths in the Import parameter. | ||
== Example Flowgraph == | |||
In the following flowgraph, we used the Import block to import fftpack from scipy (the argument to the block is 'from scipy import fftpack'). fftpack is then used to set the variable taps as 'fftpack.ifftshift(fftpack.ifft([tap3, tap4, 1.0, tap1, tap2]))' | |||
[[File:Import_example.PNG]] | |||
== Source Files == | == Source Files == | ||
Latest revision as of 21:27, 16 May 2023
Import additional python modules into the namespace.
- Examples
-
- from gnuradio.filter import firdes
- import math,cmath
- from math import pi
Parameters
- Import
- Takes the import string as input e.g. ("import math"). Python will attempt to import from whatever directory the current .grc file is in, the default system paths, and whatever is in $PYTHONPATH. You can not specify other paths in the Import parameter.
Example Flowgraph
In the following flowgraph, we used the Import block to import fftpack from scipy (the argument to the block is 'from scipy import fftpack'). fftpack is then used to set the variable taps as 'fftpack.ifftshift(fftpack.ifft([tap3, tap4, 1.0, tap1, tap2]))'