Clarify the difference between ghidra and pyghidra imports

I got confused by the distinction and the differences a few times, I
figured it could be documented better.
This commit is contained in:
Jakub Stasiak
2026-02-01 23:24:40 +01:00
parent 44510d1e84
commit 1231a520c0
@@ -25,6 +25,13 @@
them through a Python interface, which is similar to Java in some ways.
</P>
<P>
<B>Note on imports:</B> Since you are running inside Ghidra, you do <I>not</I> need to
<TT>import pyghidra</TT> or call <TT>pyghidra.start()</TT>. The <TT>pyghidra</TT> module is
only needed for standalone Python scripts running outside of Ghidra. Here, you can directly
import Ghidra API modules like <TT>from ghidra.program.flatapi import FlatProgramAPI</TT>.
</P>
<P>
As in Java, classes outside of your current package/module need to be explicitly imported.
For example, consider the following code snippet: