diff --git a/euler_profiler b/euler_profiler new file mode 100755 index 0000000..422b901 --- /dev/null +++ b/euler_profiler @@ -0,0 +1,7 @@ +#!/bin/bash + +# Used to easily profile a solution to Project Euler + +PROBLEM=$1 + +python -m cProfile -s time $PROBLEM diff --git a/euler_template b/euler_template deleted file mode 100755 index d0bab9a..0000000 --- a/euler_template +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash - -# Brrr this is ugly. You 'd better change it quickly - -TYPE=$1 -FILE="e_$1.py" - -if [ $# -gt 1 -o $# -lt 1 ]; - then - echo "Main usage is : euler_template number_of_problem" - exit 0; -fi - -#generating shellbang -#echo -e "#!"$(which $TYPE)"\n" >> $FILE -echo "#!/usr/bin/env python " >>$FILE - -#generating header -echo -e '"""' >> $FILE -echo -e " ##---" >> $FILE -echo -e " # Julien Lengrand-Lambert" >> $FILE -echo -e " #Created on : "$(date)"\n #" >> $FILE -echo -e " # DESCRIPTION : Solves problem $1 of Project Euler" >> $FILE -echo -e ' ' >> $FILE -echo -e " ##---" >> $FILE -echo -e '"""' >> $FILE - -# function prototype -echo -e 'def fun():' >> $FILE -echo -e ' """' >> $FILE -echo -e ' """' >> $FILE -echo -e ' ' >> $FILE -echo -e ' return 1' >> $FILE - -echo -e '' >> $FILE -# main -echo -e "if __name__ == '__main__':" >> $FILE -echo -e ' print "Answer : %d" % (fun())' >> $FILE - - -chmod +x $FILE