Ad
Code
Diff
  • from ctypes import *
    
    libc = CDLL("libc.so.6")
    s="Hello Python!\n"
    
    libc.printf(s.encode())
    
    • from ctypes import *
    • libc = CDLL("libc.so.6")
    • s="Hello Python!\n"
    • # for python 2.7.6
    • libc.printf(s)
    • #for python 3.4.3
    • for c in s:
    • libc.printf(c)
    • libc.printf(s.encode())