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!

typealong1

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

typealong2

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:

typingalong3

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

Edit > Preferences

typingalong4

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

typingalong5

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.

typingalong6

(Yes, another se7en  photo heart.gif!)

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

Advertisements


Leave a comment

Struggling through chapter 9, Reading Word Lists

So yeah, I am still struggling through “Think Python”. In chapter 9 you are supposed to download a document called “word.txt” from here. And then you are supposed to open the darn thing by typing this in the Python Shell (I use IDLE) fin = open(‘words.txt’). But of course when I typed it, I had to get a God darn error photo piangry.gif!

This was the error IOError: [Errno 2] No such file or directory: ‘words.txt’.

Since I wasn’t satisfied with what I learned from google, I decided to fiddle around myself, a known recipe for disaster photo loveit.gif  But when it hit me what the problem was, the Python Shell was looking for the file in the wrong place, I solved this issue in a minute.

How to check Python Shell’ s current working directory (the directory in which the Python Shell looks for data/programs). Go to File and then select Path Browser

selectpath

The Path Browser will open

pathbrowser

As you can see the path of the current working directory is /home/Roja, but I had the file saved in /home/Roja/thinkpython.

What did I do? I quickly found out I couldn’t move to the /thinkpython directory in the Path Browser. So I copied the file from /home/Roja/thinkpython to /home/Roja. It is not the most elegant solution I’ll admit  photo puh2.gif but it worked and I was able to continue with the book.

Remember, you can always do the cliccie for larger piccie!

(This is what the Python Shell looks like when it can’t find the file

cantfindfile

and this when it can

foundfile)


2 Comments

How to install IDLE in Fedora

This tutorial is for Python versions 2.****!

If you are going to clown around in Python, you’ ll need an interpreter. An interpreter is basically, a piece of software that translates the code you’ve written (source code) into something a computer can read(machine language).

interpret

(output = computer)

The interpreter I currently use is IDLE, it’s light, simple in use and ideal for beginners. IDLE stands for “Integrated DeveLopment Environment” and is written in and exclusively for python. This means you can’t write code for another language, like C in IDLE!

How to install IDLE:

  • open terminal
  • log in as root
  • type “yum install python-tools” (without the quotation marks) if you are using versions  of Fedora untill 21 or type “dnf install python-tools” (without the quotation marks) if you are using versions from Fedora 22

installatianIDLE
After the installation, you’ ll notice something interesting, unlike most programs IDLE can’t be found in the application menu (i.e. there is no Desktop icon to click on).  IDLE can only be opened through terminal and it, depending on your settings of course, doesn’t require you to be root to execute it.

How to open IDLE:

  • open terminal
  • type “idle”

idleterminal

The following screen will open:
pythonshell

WARNING: Do not close terminal while working in IDLE, if you do so IDLE will close too!!

Remember, you can do the cliccie for larger piccie and the first picture came from here.


1 Comment

I’ve turned to the dark side

As you know I gave up, for now,  on the courses Learn Python the Hard Way and the Python course at Code Academy. I quit with the first because I had really no clue of what I was doing ( I was at lesson 25 mind you Photobucket ). I dropped out at the  Code Academy because the part about Boolean became to mathematical for me,  it felt like cheating to guess or Google the answers . I’ll go back to the Code Academy when I’ve finished the arithmetic and pre-algebra part at the Khan Academy. Yesterday I started  the Python course at Khan Academy,  but I soon found out that tinkering along with Khan in vi doesn’t exactly work Photobucket

I went to look for an IDE, I tried Geany I hated it, I tried Eclipse, I hated that even more. What’s going on with all these whistles and blows? I now can see why a lot of programmers, after using these kind IDE’s for years go back either to vi or Vim.  I might be a sloppy person, but I prefer my software to be lean, mean, clean and fast as lightening. I don’t want it to take light years to even fucking load, I am looking at you here Eclipse Photobucket After those two failures I went for IDLE, and I like it, not as much as vi but I like it. It will do fine for tinkering along with youtube vids. The only thing I don’t like about IDLE is that I can’t “dock” or “glue” the windows together. This is what Desktop looks like when I’m learning Python:

cliccie for larger piccie

cliccie for larger piccie