Ad
Code
Diff
  • 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)
    
    • import sys
    • sys.stdout.write("Hello Python!
    • ")
    • from ctypes import *
    • libc = CDLL("libc.so.6")
    • s="Hello Python!
    • "
    • # for python 2.7.6
    • libc.printf(s)
    • #for python 3.4.3
    • for c in s:
    • libc.printf(c)