I have two Python scripts
2011/2/dinner/dinner.py
2014/qualification/cookie-clicker-alpha/cookie-clicker-alpha.py
They both define identical functions binary_search
. For maintainability, I would like to move that function to a new file
helpers/binary_search.py
Then import it from dinner.py
and cookie-clicker-alpha.py
. How can I do that? I am using Python 3.x .
Finally, it's important to me that python dinner.py
still works out the box for anyone who clones my code:
git clone https://github.com/hickford/codejam.git
cd codejam
cd 2011/2/dinner
python dinner.py sample.in