import platform
print platform.release()
Reference :
windows - How to check if OS is Vista in Python? - Stack Overflow
import platform
print platform.release()
try: os.remove('abc.file') except WindowsError, value: print value.args
Linux 上不能用這個, 請改用其他
import os
os.environ['COMPUTERNAME']
要填入的資訊可以參考下面鏈接 |
echo "pyflakes ...."
for f in `find . -name "*.py"`; do
pyflakes $f >> pyflakes.log
done || :
/**
* Behaves just like the python range() built-in function.
* Arguments: [start,] stop[, step]
*
* @start Number start value
* @stop Number stop value (excluded from result)
* @step Number skip values by this step size
*
* Number.range() -> error: needs more arguments
* Number.range(4) -> [0, 1, 2, 3]
* Number.range(0) -> []
* Number.range(0, 4) -> [0, 1, 2, 3]
* Number.range(0, 4, 1) -> [0, 1, 2, 3]
* Number.range(0, 4, -1) -> []
* Number.range(4, 0, -1) -> [4, 3, 2, 1]
* Number.range(0, 4, 5) -> [0]
* Number.range(5, 0, 5) -> []
* Number.range(5, 4, 1) -> []
* Number.range(0, 1, 0) -> error: step cannot be zero
* Number.range(0.2, 4.0) -> [0, 1, 2, 3]
*/
function range() {
var start, end, step;
var array = [];
switch(arguments.length){
case 0:
throw new Error('range() expected at least 1 argument, got 0 - must be specified as [start,] stop[, step]');
return array;
case 1:
start = 0;
end = Math.floor(arguments[0]) - 1;
step = 1;
break;
case 2:
case 3:
default:
start = Math.floor(arguments[0]);
end = Math.floor(arguments[1]) - 1;
var s = arguments[2];
if (typeof s === 'undefined'){
s = 1;
}
step = Math.floor(s) || (function(){ throw new Error('range() step argument must not be zero'); })();
break;
}
if (step > 0){
for (var i = start; i <= end; i += step){
array.push(i);
}
} else if (step < 0) {
step = -step;
if (start > end){
for (var i = start; i > end + 1; i -= step){
array.push(i);
}
}
}
return array;
}
分析要點
|
正常肉片
|
組合肉片
|
外觀
|
每片都不規則
|
是圓咚咚的薄肉片(切厚片會穿幫)
|
油花
|
常是網狀
|
常是塊狀
|
紋理
|
紋理不同
|
紋理很一致
|
味道
|
有口感
|
很容易破碎鬆散
|
烹煮
|
較少泡沫
|
很多白色泡沫
|
Execute shell
echo "clonedigger ...." clonedigger --cpd-output -o clonedigger.xml .
Execute shell
echo "pep8 ...." #pep8 --filename=*.py . > pep8.txt find . -name "*.py" -exec pep8 {} \; >> pep8.txt
Execute shell
echo "pylint ...."
for f in `find . -name "*.py"`; do
pylint --output-format=parseable --reports=y $f >> pylint.log
done || :
Execute shell
sloccount --duplicates --wide --details *.py | fgrep -v .svn > sloccount.sc || :
Execute shell
echo "pyflakes ...."
for f in `find . -name "*.py"`; do
pyflakes $f >> pyflakes.log
done || :
import base64
foo = base64.b64encode('12345')
print base64.b64decode(foo)
# 把這行註解掉, 就不需要在 whell 群組也可以使用 su
#auth required pam_wheel.so
# 这表明只有"wheel"组的成员可以使用su命令成为root用户。你可以把用户添加到“wheel”组,以使它可以使用su命令成为root用户。
auth required /lib/security/pam_wheel.so group=wheel
var myString = [' ' ].join('\n');
var myString =
'
';
var string = 'This is ' +
'multiline' +
'string';
Reference :
javascript - How to create multiline strings - Stack Overflow