Last active
August 29, 2015 14:01
-
-
Save allieus/03e005bfb89a86fd997d to your computer and use it in GitHub Desktop.
지정한 여러 파이썬 쉘의 결과를 vimdiff 로 비교
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
#!/bin/sh | |
INTERPRETERS=( python2.5 python2.7 python3.4 ) | |
if [ 1 -eq $# ]; then | |
script_path=$1 | |
tempfiles=() | |
for interpreter in ${INTERPRETERS[@]}; do | |
tempfile=`mktemp -t ""` | |
$interpreter $script_path >$tempfile 2>&1 | |
tempfiles+=($tempfile) | |
done | |
vimdiff ${tempfiles[@]} | |
for tempfile in ${tempfiles[@]}; do | |
rm $tempfile | |
done | |
exit 0 | |
else | |
echo "usage> $0 <python-script-path>" | |
exit 1 | |
fi |
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 | |
print(sys.version) | |
major_version = sys.version_info[0] | |
for i in range(1, 10): | |
print('{} * {} = {}'.format(i, major_version, major_version * i)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment