前奏
在linux中可以运行:
npm ERR! Windows_NT 6.1.7600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs
node_modules\\npm\\bin\\npm-cli.js" "install" "ionic" "-g"
npm ERR! node v5.0.0
npm ERR! npm v3.3.6
npm ERR! Callback called more than once.
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
C:\Users\<users>\AppData\Roaming\npm
└── (empty)
npm ERR! Windows_NT 6.1.7600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs
node_modules\\npm\\bin\\npm-cli.js" "install" "ionic" "-g"
npm ERR! node v5.0.0
npm ERR! npm v3.3.6
npm ERR! Callback called more than once.
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
C:\Users\<users>\AppData\Roaming\npm
└── (empty)
npm ERR! Windows_NT 6.1.7600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs
node_modules\\npm\\bin\\npm-cli.js" "install" "ionic" "-g"
npm ERR! node v5.0.0
npm ERR! npm v3.3.6
npm ERR! Callback called more than once.
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! C:\Windows\system32\npm-debug.log
npm ERR! code 1
得到结果:
showhide
问题
我想以编程方式从Linux和Windows中的Python脚本中获取此结果。
动机
我有几个Python脚本,我想使用cython编译为C.我正在尝试创建一个可以处理此编译过程的Python脚本。
有三个文件:$(document).ready(function() {
$(".cards").find(":gt(4)").hide();
$(".cards").append("<p class=\"showhide\">Show More</p>");
$(".cards").on("click", ".showhide", function(ev) {
var showhide = $(this);
var container = showhide.parent();
if (showhide.text() == "Show More") {
container.find(":gt(4)").show();
showhide.text("Show Less");
} else {
container.find(":gt(4)").hide();
showhide.text("Show More");
}
});
});
,$ pkg-config --cflags --libs python3
,-I/usr/include/python3.5m -lpython3.5m
;所需的执行顺序是:
exec.py
apkg.py
bpkg.py
cython --embed exec.py
cython apkg.py
cython bpkg.py
gcc -shared -fPIC -O3 -I/usr/include/python3.5m -lpython3.5m apkg.c -o apkg.so
而gcc -shared -fPIC -O3 -I/usr/include/python3.5m -lpython3.5m bpkg.c -o bpkg.so
将是一个已编译的可执行文件,需要在同一目录中运行apkg.so和bpkg.so。
可靠答案
使用gcc -c -O3 -I/usr/include/python3.5m -lpython3.5m exec.c
:从版本3.5开始,Windows的Python安装程序(64位试用)不包括gcc -o exec exec.o
用户exec
:再次出现Windows兼容性问题。