Peter Miller

Musings on Technology and Programming
in

How To Get Really Distracted And Not Learn Any Python

The following is a graphical breakdown of how I spent the first 40 hours or so “learning” Python, plus an excuse to show off the Google Visualization API:

 
 
As you can see, based on these extremely scientific measurements, I spent the majority of this time not writing Python code, reading about it or watching screencasts, but instead fiddling around the edges. These are important edges; as a .NET programmer by trade, I know well the importance of a good IDE. Source Control is a given, while Test Driven Development (TDD) is a staple of many non-corporate programming environments. And of course you cannot write any code if your environment is not set up correctly.
 
So why do I call this time spent “fiddling”? Because of the way I approached it. I took having a good IDE to mean finding a Visual Studio for Python. This meant installs and brief trials of Wing IDE, IronPython Studio, Eclipse and E-Text Editor. TDD was slow sledding when the test was really writing anything that worked. Environment setup became an brief foray into Linux followed by endless tweaks of Windows settings to come up with the perfect Python environment.
 
I approached getting started with Python as I would setting up a new machine for .NET development, except I have years of experience with .NET and know exactly what I want, whereas I was grasping in the dark with Python. Once I got past these obstacles and got rolling (in Vista, with SVN and Eclipse for the curious), I actually began making some progress. While I learned a lot from the process, it was also needlessly frustrating. If learning Python was my number one goal it would have been better to just take others’ advice, get set up by following a laundry list of instructions and try to end up with a more distraction free allocation like this:
 

Of course, far be it for me to take my own advice, and I have not been able to resist taking some time to brush up on my JavaScript, which lead me to the Google Visualization API, which is responsible for the oh so orange graphs in this post. The Visualization API is one of many JavaScript libraries which Google hosts on its servers, allowing you to load them onto your own page hassle free. Not all the libraries are Google-made, the impressive jQuery is another library you can import off of Google’s servers. I did not do much more with the Visualization API then you can see in the “Hello World” examples, but the magic is there in the source of this page if you are curious. <Updated post to display better in RSS readers>

Comments

masklinn said:

> as a .NET programmer by trade, I know well the important of a good IDE

If you passed as long toying with IDEs as actually learning python, then I think you don't.

Or at least you only know the importance of a good IDE in the likes of C# or Java, which mandate the use of an IDE. Python doesn't, your time spent on toying with IDEs should have been 0.

# June 6, 2008 3:21 AM

anontrol said:

You might want to take a look at what your article looks like in an RSS reader (Sage under Firefox, for me) and then hit the books/blogs again.

google.load("visualization", "1", {packages:["imagepiechart"]}); google.setOnLoadCallback(drawChart); function drawChart() { var data = new google.visualization.DataTable(); data.addColumn('string', 'Task'); data.addColumn('number', 'Percentage of Time'); data.addRows(5); data.setValue(0, 0, 'Python'); data.setValue(0, 1, 40); data.setValue(1, 0, 'Env. Setup'); data.setValue(1, 1, 15); data.setValue(2, 0, 'Source Control'); data.setValue(2, 1, 6); data.setValue(3, 0, 'TDD'); data.setValue(3, 1, 6); data.setValue(4, 0, 'IDE'); data.setValue(4, 1, 35); var chart = new google.visualization.ImagePieChart(document.getElementById('chart_div')); chart.draw(data, { colors: new Array('#CC6600'), width: 400, height: 240, title: 'Allocation of first 40 hours (actual)'}); } google.setOnLoadCallback(drawChart2); function drawChart2() { var data = new google.visualization.DataTable(); data.addColumn('string', 'Task'); data.addColumn('number', 'Percentage of Time'); data.addRows(5); data.setValue(0, 0, 'Python'); data.setValue(0, 1, 85); data.setValue(1, 0, 'Env. Setup'); data.setValue(1, 1, 2); data.setValue(2, 0, 'Source Control'); data.setValue(2, 1, 2); data.setValue(3, 0, 'TDD'); data.setValue(3, 1, 2); data.setValue(4, 0, 'IDE'); data.setValue(4, 1, 2); var chart2 = new google.visualization.ImagePieChart(document.getElementById('chart_div2')); chart2.draw(data, { colors: new Array('#CC6600'), width: 400, height: 240, title: 'Allocation of first 40 hours (ideal)'}); }

# June 6, 2008 4:46 AM

Scott Williams said:

Could you describe your setup then? Which IDE did you end up settling with?

# June 6, 2008 2:40 PM

Peter Miller said:

masklinn - I was describing my time allocation as an example of what not to do; I agree I spent too much time setting up IDEs. I'm still learning Python and now spend about zero time on these factors. I do still prefer the niceties of an IDE, such as Eclipse

anontrol - I fixed the markup on the page and now the javascript is in a seperate file that I include with a script tag, so it should look better in your RSS reader now

Scott - I will put together another post with more details, but the short version is: I am using Eclipse with PyDev as my IDE. The PyDev site has some good tips on getting it set up. Other than that, I downloaded the windows Python installer and went from there. For source control, I am using SVN, installed as a local service, with Tortoise SVN explorer integration.

# June 6, 2008 7:05 PM

Sebastian Aviña said:

total time in ubuntu:

sudo apt-get install emacs

sudo apt-get install python

download and install pymacs, ecb, ropemacs

10 min?

you're ready, s

# June 6, 2008 10:23 PM

Daniel said:

Sebastian: yeah, because emacs is known for being so easy to deal with.

In reality, you wouldn't have to install the python package (as it's pretty much mandatory in a GNOME-based distro), and would spend most of those 40 hours learning how to use emacs effectively in the first place.

# June 8, 2008 7:13 PM

Peter Miller said:

My previous post, How To Get Really Distracted and Not Learn Any Python , generated enough interest

# June 10, 2008 12:58 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)