Package ghidra.python

Class PythonUtils

java.lang.Object
ghidra.python.PythonUtils

public class PythonUtils extends Object
Python utility method class.
  • Field Details

  • Constructor Details

    • PythonUtils

      public PythonUtils()
  • Method Details

    • setupPythonHomeDir

      public static File setupPythonHomeDir() throws IOException
      Sets up the python home directory. This is the directory that has the "Lib" directory in it.
      Returns:
      The python home directory.
      Throws:
      IOException - If there was a disk-related problem setting up the home directory.
    • setupPythonCacheDir

      public static File setupPythonCacheDir(TaskMonitor monitor) throws CancelledException, IOException
      Sets up the python cache directory. This is a temporary space that python source files get compiled to and cached. It should NOT be in the Ghidra installation directory, because some installations will not have the appropriate directory permissions to create new files in.
      Parameters:
      monitor - A monitor to use during the cache directory setup.
      Returns:
      The python cache directory.
      Throws:
      IOException - If there was a disk-related problem setting up the cache directory.
      CancelledException - If the user cancelled the setup.