or more practically: ```val createPythonDef = task...
# kotlin-native
m
or more practically:
Copy code
val createPythonDef = tasks.create("createPythonDef") {
    fun getVar(name: String) : String {
        return ByteArrayOutputStream().use { os ->
            val result = exec {
                executable = "python3"
                args = listOf("-c", "import sysconfig; print(sysconfig.get_paths()['$name'])")
                standardOutput = os
            }
            os.toString().removeSuffixIfPresent("\n")
        }
    }

    doLast {
        val lib = getVar("stdlib").split("/").toMutableList()
        val libName = lib.removeLast()
        val libPath = lib.joinToString("/")
        val includePath = getVar("platinclude")

        File(project.projectDir.absolutePath + "/src/nativeInterop/cinterop/python.def.template").inputStream().use { istream ->
            File(project.projectDir.absolutePath + "/src/nativeInterop/cinterop/python.def").outputStream().use { ostream ->
                val content = istream.readAllBytes().decodeToString()
                val formatted = content.format(includePath, libPath, libName)
                ostream.write(formatted.encodeToByteArray())
            }
        }
    }
}

tasks.getByName("cinteropPythonNative") {
    dependsOn(createPythonDef)
}
How would I make sure this runs for everyone and makes the library work as intended, assuming they have python3 installed, or alternatively, how would I make it so I don't need to use the def on the library side but still use the types that are required for my library to work?