This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
arigo@catsnake:/tmp/x$ python x_build.py | |
generating ./StrategyBasic.c | |
running build_ext | |
building 'StrategyBasic' extension | |
gcc -pthread -fno-strict-aliasing -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -I/usr/include/python2.7 -c StrategyBasic.c -o ./StrategyBasic.o | |
gcc -pthread -shared -Wl,-O1,--sort-common,--as-needed,-z,relro ./StrategyBasic.o -L/usr/lib -lpython2.7 -lpython2.7 -o ./libStrategyBasic.so | |
arigo@catsnake:/tmp/x$ gcc main.c -L. -lStrategyBasic | |
arigo@catsnake:/tmp/x$ LD_LIBRARY_PATH=. a.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from struct import pack, unpack | |
import random | |
class Primes: | |
Salt = 0x1 | |
Air = 0x2 | |
Earth = 0x3 | |
Fire = 0x4 |