Fundamentals of Physics and Python
2014
07.22
Fundamentals of Physics and Python
Category: Uncategorized / Tags: no tag / Add Comment
There’s ~lots~ of programming resources out there. Many books (good and bad), and many
websites (good and just don’t ever go there). In my experience of almost 10 years now, it’s
finally time I gave the Python programming language a fair shot. Scripting languages are
what originally got me into programming from the beginning, HTML/CSS with javascript for
some flare back in highschool, then lua for Garry’s Mod 9.0.4 and then 10. Lua is the
language that really got me into programming, then 2007 I started with C#. Then went what
feels like backwards to website development with PHP and MySQL. If there is a hell, it’s
web development. Realising my mistake, I gave android development a go, but at the time
wasn’t comfortable with the documentation or the amount of setting up required to get a basic
application working; I’m sure all of that has changed now. Along came college, and was
thrown a whole range of different languages we had to write in. Mostly C++, but some
modules on PHP/Javascript and a project which I wrote in Lua. In between is the countless of
hours reading programming forums, blog posts, watching latest tech talks and university
lectures online, and of course reading lots of programming books, I still don’t feel like I’ve
matured yet as a programming, there’s always more to learn. There’s one thing I never got
around to learning though, and that’s Python.
Python, from what I’ve heard of over the years is a brilliant scripting language with lots of
libraries, easy to pick up, and is used for a wide range of generic automated tasks. Why did I
never learn it? Well I never felt a need to learn it. Lua was always there for me when I needed
automated tasks being done. But I think it’s time I put Lua aside for a few months, and give
Python a go. So I’ll be using Python 3.4.1, and setting up a simple environment to experiment
in. For windows I’ll be using notepad++ with the NppExec plugin and my script to execute
the current file through the python interpreter, and for Mac OSX, good ol’ ViM; of course
github to keep everything in sync and keep track of the source code.
Then comes the next step, what to program? There are many lists online on “what to
program” or “programming ideas”, but this time lets get two birds with one stone; I’m going
to attempt to complete all the questions and problem sets listed in the Fundamentals of
Physics text book 8th Edition. Why? It was my brothers book that was always on my
bookshelf, and it contains lots of questions which can be solved with programming; plus I’ll
be learning about physics. Many of the questions will be basic plug in numbers to a formula
and print the result, but later on in the textbook I could easily expand to create more graphical
answers using some python frameworks available. Some that come to mind is light
diffraction or displaying magnetic fields. It will be a (very) long process to complete the
book, but a great achievement to do so.
All source code will be published to this github repository.