Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've recently installed ubuntu 12.04 on my oldie ThinkPad, along with Python-interpreter idle and obviously Python.

I'm looking to learn the basics of this programming language, but I've had no luck finding a conclusive beginners guide for the most recent Python that doesn't require knowledge of previous coding language.

I know how to use the GUI and use terminal for installation or basic tasks, and I have a basic knowledge of BASIC (goto, print, input, if, next, etc.) But absolutely no knowledge of Python or any other coding.

If someone could briefly explain or point me in the right direction to a guide, that would be great!

Also, if anyone can recommend a better language to start off with for a beginner, I would be very interested. However, from what I've researched it seems Python is the most supported cross-platform and in general?

Thanks in advance.

share|improve this question
    
Dive Into Python 3. –  Pedro Romano Nov 10 '12 at 13:09
    
Some more resources are discussed here: askubuntu.com/questions/84255/… –  user76204 Nov 10 '12 at 14:12
    
Codeacademy now has many interactive python exercises, which are very useful for learning the language. –  user76204 Nov 10 '12 at 14:23
add comment

closed as off topic by Jorge Castro, Ringtail, jokerdino, Stephen Myall, devav2 Nov 10 '12 at 18:54

Questions on Ask Ubuntu are expected to relate to Ubuntu within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers

When I started python I followed the official documentation, but it seemed too complicated for me at the time.

The way I really started to learn python was using it all the time. Here where I work, I had to backup some files, this was my first official project with python, it took me about a week to finish it. I had to search on google each time I had a problem, but after some time, you get used to the overall language syntax.

I really recommend you start learning python first, I started learning programming using C, it was hard and I couldn't understand much of it, if I had started with python, my life would be a lot easier. The reason for this is that python is interpreted, the errors are much more readable, for a begginner:

Example of the classic Hello World in python:

 print "Hello, World!" 

Now the same program in the C++ language:

#include <iostream>

int main()
{
   std::cout << "Hello, World!" << std::endl;
   return 0;
}

At the time, I had many questions when I saw this and I was too terrified to start programming in C++, if I had started with python or C#, I wouldn't be that scarified of learning a new language.

share|improve this answer
    
Many thanks for your insight, very helpful! I was already a little bit scared of Python, C++ is terrifying! –  Nilo Nov 10 '12 at 19:27
add comment

Go for Python !!
The approach which I think would be a good for learning it:

  1. Start with: http://docs.python.org/2/tutorial/ . The tutorial'll get you started.
  2. Once you feel comfortable and want to learn more python, start looking at library reference section of docs.python.org website.
  3. With this you can go for reading code for the libraries present already in the directory /usr/lib/pythonX where X is the version of python you have on your machine. Reading the functions present in these files would familiarize you with the style and conventions you could use to write standard python code and other tricks-n-treats too.
  4. If you don't want to learn the language too deeply, you could skip step 3 and just start writing some application in python. In essence, just start practising rather than reading standard code. But this is a hard way to learn things.. But that's just my opinion.

In summary, Follow docs.python.org website's tutorial for starting. Then go for other text present on this website. You can read the code present in standard library while referring the website to learn the style you could write python in.

share|improve this answer
    
Thanks a bunch, these are great steps! –  Nilo Nov 10 '12 at 19:57
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.