tuxmartin

Python kompilace

Nov 27th, 2015
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. martin@pc:~/python_test$ cat test.py
  2. from datetime import datetime
  3.  
  4. def wtf(cas):
  5. print "Je %s hodin." % cas
  6.  
  7. hodiny = datetime.now().strftime('%H:%M:%S')
  8. wtf(hodiny)
  9.  
  10. martin@pc:~/python_test$ python test.py
  11. Je 11:36:52 hodin.
  12. martin@pc:~/python_test$
  13. martin@pc:~/python_test$ cython --embed test.py
  14. martin@pc:~/python_test$
  15. martin@pc:~/python_test$ gcc test.c -I/usr/include/python2.7 -lpython2.7 -o test
  16. martin@pc:~/python_test$
  17. martin@pc:~/python_test$ ./test
  18. Je 11:37:15 hodin.
  19. martin@pc:~/python_test$
  20. martin@pc:~/python_test$ ldd test
  21. linux-vdso.so.1 => (0x00007ffd15fb9000)
  22. libpython2.7.so.1.0 => /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0 (0x00007f3def0f9000)
  23. libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3deed2f000)
  24. libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f3deeb10000)
  25. libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f3dee8f6000)
  26. libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f3dee6f2000)
  27. libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f3dee4ee000)
  28. libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f3dee1e6000)
  29. /lib64/ld-linux-x86-64.so.2 (0x0000563df79ed000)
  30. martin@pc:~/python_test$
  31. martin@pc:~/python_test$
  32. martin@pc:~/python_test$ ls -lh
  33. celkem 160K
  34. -rwxrwxr-x 1 martin martin 43K lis 27 11:37 test
  35. -rw-rw-r-- 1 martin martin 112K lis 27 11:37 test.c
  36. -rw-rw-r-- 1 martin martin 134 lis 27 11:33 test.py
  37. martin@pc:~/python_test$
Advertisement
Add Comment
Please, Sign In to add comment