Python

class Python

A class for extracting the necessary configuration properties for embedding a specific Python interpreter into an appication

Companion
object
class Object
trait Matchable
class Any

Value members

Concrete methods

def scalapyProperties: Try[Map[String, String]]

Provides the system properties necessary for setting up ScalaPy with this Python interpreter

Provides the system properties necessary for setting up ScalaPy with this Python interpreter

Example
import me.shadaj.scalapy.py
Python("/usr/local/bin/python3").scalapyProperties.get.foreach {
 case (k, v) => System.setProperty(k, v)
}
println(py.eval("'Hello from Python!'"))

Concrete fields

lazy
val executable: Try[String]

Absolute path to the Python interpreter executable

Absolute path to the Python interpreter executable

lazy
val ldflags: Try[Seq[String]]

Provides the recommended linker options for embedding this Python interpreter into another application, mostly extracted from the outputs of

Provides the recommended linker options for embedding this Python interpreter into another application, mostly extracted from the outputs of

pythonX.Y-config --ldflags for python 3.7 and

pythonX.Y-config --ldflags --embed for python 3.8+

lazy
val nativeLibrary: Try[String]

Name of the libpython corresponding to this Python interpreter, ''e.g.'' python3.8, python3.7m

Name of the libpython corresponding to this Python interpreter, ''e.g.'' python3.8, python3.7m

lazy
val nativeLibraryPaths: Try[Seq[String]]

Provides a list of possible locations for the libpython corresponding to this Python interpreter

Provides a list of possible locations for the libpython corresponding to this Python interpreter