Skip to content

Instantly share code, notes, and snippets.

Created July 15, 2017 21:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/604aa4fa4ef7f39cd50cefaf8eaccea3 to your computer and use it in GitHub Desktop.
Save anonymous/604aa4fa4ef7f39cd50cefaf8eaccea3 to your computer and use it in GitHub Desktop.
Python bindings for Crystal
@[Link("python3")]
lib Python3
fun exit = Py_Exit(status : Int32) : Void
fun snprintf = PyOS_snprintf(str : UInt8*, size : LibC::SizeT, format : UInt8*, ...) : Int32
end
msg = "hi python\n"
Python3.snprintf(msg, msg.size, "")
Python3.exit(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment