EulerPy 1.0.8
Pythonbased Project Euler command line tool.
Latest Version: 1.2.3
EulerPy is a command line tool designed to streamline the process of solving Project Euler problems using Python. The package focuses on two main tasks: firstly, to create Python “template” files with a docstring containing the text of a Project Euler problem for easeofreference, and secondly, to check whether a problem has been solved correctly.
Installation
EulerPy can be installed (and updated) from PyPI using pip:
$ pip install upgrade EulerPy
Conversely, it can be uninstalled using pip as well.
$ pip uninstall EulerPy
Usage
First, you’ll want to cd to the directory where your Project Euler files are being stored.
$ mkdir ~/projecteuler $ cd ~/projecteuler
At this point, you’ll probably want to run the euler command, which will prompt to create 001.py, a file containing the text to Project Euler problem #1 as its docstring.
$ euler No Project Euler files found in the current directory. Generate file for problem #1? [Y/n]: Y Successfully created "001.py". $ cat 001.py """ Project Euler Problem #1 ========================= If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000. """
At this point, you can open up your editor of choice and code up a solution to the problem, making sure to print() the output. Once you feel that you’ve solved the problem, run the euler command again to verify your solution is correct. If the answer is correct, the solution will be printed in green and the script will ask to generate the next problem file. If incorrect, the solution will be printed in red instead. Additionally, the time elapsed during the solutionchecking process will also be printed.
$ euler Checking "001.py" against solution: [no output] # (output in red) $ echo print 42 >> 001.py $ euler Checking "001.py" against solution: 42 # (output in green) Generate file for problem #2? [Y/n]: Y Successfully created "002.py".
EulerPy also comes with five options that act as commands. (The help option can be used to display a summary of all of the options.)
cheat / c
The cheat option will print the answer to a problem after prompting the user to ensure that they want to see it. If no problem argument is given, it will print the answer to the problem that they are currently working on.
$ euler cheat View answer to problem #2? [y/N]: Y The answer to problem #2 is <redacted>. $ euler cheat 100 View answer to problem #100? [y/N]: Y The answer to problem #100 is <redacted>.
generate / g
The generate option will create a Python file for the given problem number. If no problem number is given, it will overwrite the most recent problem with a file containing only the problem docstring (after prompting the user).
$ euler generate Generate file for problem #2? [Y/n]: Y "002.py" already exists. Overwrite? [y/N]: Successfully created "002.py". $ euler generate 5 Generate file for problem #5? [Y/n]: n Aborted!
euler <problem> is equivalent to euler generate <problem> if the file does not exist.
$ cat 005.py cat: 005.py: No such file or directory $ euler 5 Generate file for problem #5? [Y/n]: n Aborted!
preview / p
The preview option will print the text of a given problem to the terminal; if no problem number is given, it will print the current problem instead.
$ euler preview Project Euler Problem #2 Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... Find the sum of all the evenvalued terms in the sequence which do not exceed four million. $ euler preview 3 Project Euler Problem #3 The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143?
skip / s
The skip option will prompt the user to “skip” to the next problem.
$ euler skip Current problem is problem #2. Generate file for problem #3? [y/N]: Y Successfully created "003.py".
verify / v
The verify option will check whether a given problem file outputs the correct solution to the problem. If no problem number is given, it will check the current problem.
$ euler verify Checking "003.py" against solution: [no output] # (output in red) $ euler verify 1 Checking "001.py" against solution: <redacted> # (output in green)
euler <problem> is equivalent to euler verify <problem> if the file does exist.
$ cat 001.py """ Project Euler Problem #1 ========================= ... """ $ euler 1 Checking "001.py" against solution: <redacted>
Contributing
See CONTRIBUTING.rst.
Miscellaneous
The text for problems 1 through 202 were derived from Kyle Keen’s Local Euler project, and the solutions in solutions.txt were derived from the projecteulersolutions wiki.
See this blog post for insight into the development process.
License
EulerPy is licensed under the MIT License.
File  Type  Py Version  Uploaded on  Size  

EulerPy1.0.8.tar.gz (md5)  Source  20140707  74KB  
 Downloads (All Versions):
 90 downloads in the last day
 304 downloads in the last week
 1575 downloads in the last month
 Author: Kevin Yap
 Home Page: https://github.com/iKevinY/EulerPy
 Keywords: EulerPy,euler,projecteuler,projecteuler
 License: MIT License

Categories
 License :: OSI Approved :: MIT License
 Programming Language :: Python
 Programming Language :: Python :: 2
 Programming Language :: Python :: 2.6
 Programming Language :: Python :: 2.7
 Programming Language :: Python :: 3
 Programming Language :: Python :: 3.2
 Programming Language :: Python :: 3.3
 Topic :: Utilities
 Package Index Owner: iKevinY
 DOAP record: EulerPy1.0.8.xml