La Boina Roja

The struggles off a future RHCE….

Leave a comment

How to make typing along with Python tutorials easier.

A lot of youtube vids use IDLE in their tutorial, there is absolutely nothing wrong with that. In matter of fact, it makes typing along easier if you use IDLE too, but situations like in the picture below piss me off photo piangry.gif!


I prefer this  photo shiny.gif it saves me the hassle of changing screens.


So what happened in the second picture? Well, I used Python’s built in interpreter which you can open by simply typing python in the terminal. Look:


And I made the terminal’s background color transparent by changing it’s transparency. You do this by

Edit > Preferences


The following screen will appear, select the tab Appearance, in this tab you can change the transparency settings.


If you are finished with the interpreter but have other stuff to do in terminal, all you have to do is press CTRL d and the interpreter will close and you can do whatever you need to do in terminal.


(Yes, another se7en  photo heart.gif!)

(Remember, you can always do the cliccie for larger piccie photo puh2.gif)


Leave a comment

If, elif and else explained

The credits for this explanation all go to zlozlozlozlozlozlo a user at reddit. I thought his explanation is worth sharing with you guys null

The if-if-else chain
if A:
>>>do_foo # this gest executed if A evaluates to True
if B:
>>>do_bar #this gest executed if B evaluates to True (regardless of A)
>>>do_baz #this gets executed if B doesn't evaluate to True (again, regardless of A)

The if-elif-else chain:

if A:
>>>do_foo #this gest executed if A evaluates to True
elif B:
>>>do_bar #this gets executed if A doesn't evaluate to True but B does
>>>do_baz # this gest executed if neiter A or B evaluaes to True

Only one of the three is executed in the above if-elif-else chain.

If you need more explanation null there are more people who also did a great job explaining this to me here.

Leave a comment

My own Python challenge

Earlier this morning while working on my math, I had to calculate the LCM (Least Common Multiple) and I was thinking I should write a Python script for it. Just for fun. Yeah “fun” I probably am  going insane null

There is no need to point out the math module in Python,  which probably has a function called LCM.

So I typed what I know right now:

cliccie for larger piccie

cliccie for larger piccie

While advancing in Python, I will improve this script null (I know that I’ve written a loop and that I should make it stop after the first hit, otherwise it will go on forever null)

Leave a comment

Join reddit!

Don’t give me that face null


I know it has quite the reputation, but there are some subreddits out there that will help you out while you are learning to program. By this, I don’t mean you should post your homework there and expect some redditor to do it for you null

By reading frequently on some relevant subreddits, you’ll learn so much. Not only about programming but alos on other relevant things you need to know if you are an aspiring programmer. Hell even the touchy feely stuff, like insecurity, is being discussed there and it amazes me how kindly people react to it. The only time I saw someone behave like a jerk, he got called on it by other redditors null

These particular subreddits are also n00b friendly. You can ask a question that has been asked by other many times and no one ever will write something like ” Use the FREAKING search”. Instead they take time to answer the question like it is the first time someone asked this particular question.

The subreddits I am talking about are:

My username there is RojaB and if you must know, no I didn’t create that “drawing” myself.  I can see why you asked though null

Leave a comment

Recommendation: The Art and Craft of Programming: Python Edition

Free e book written by John C. Lutsh available in HTML and PDF format, this book will not teach you to program. You will learn about how and why things work the way they do in Python on a basic level.

This is a well written starters guide, the PDF file is about 138 pages long. The writer is very novice friendly he, bothers to explain what precedence is for example. He does this in very a efficient and effective way, I personally liked how he explained assignments

cliccie for larger piccie

I myself will not go through the entire book from beginning to end, but seeing how he explains basic things rather well, I will use this book as a reference guide. That is another beauty of this book, it is written so well you only can go through the for you  relevant chapters. Without worrying whether you should have read the chapters before it or not. He should add a search function on the HTML version of the book though null

He has some small exercises in the book, with (thank God null) the answers.

The book is about Python 3, but since the writer is teaching you about concepts in Python,  you can use this book for Python 2 too.

Leave a comment

I am in looooooveeeeeee!!!

loveSo three days ago I wrote this rant  photo bloos.gif and now I write to tell you that I have fallen for Python, I am not saying it clicks. But while I was going through the course “List & Dictionaries”, which is brilliantly written by James Watson, I realized I loved this.

I don’t know  if this for some reason reminds of the stuff I used to do in MS Access or because I find this section incredibly easy. I do can tell you that I think two things right now “I should have done this earlier” and “I really enjoy doing this”  photo heart.gif!