LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Learning Python...how? (http://www.linuxquestions.org/questions/programming-9/learning-python-how-863931/)

MystKid 02-20-2011 06:54 PM

Learning Python...how?
 
hello guys i have never tryed programming anyhing. i was wondering inhow i can start learning python. i use archlinux with openbox. do i need any specific tools or jsut a text editor? sorry for the noob question . from the tutorials online i see many tools like pygtk glade and so on and i cant understand anything

corp769 02-20-2011 07:35 PM

Read, read and read! That's the only way man...

As far as what you need, you can use an IDE or just a plain text editor. For being a beginner, I recommend using an IDE like eclipse so it will help you as far as syntax highlighting, etc.

Here are a few links to get you started with python:

http://www.sthurlow.com/python/
http://www.tutorialspoint.com/python/

Notice to you though: I have found these links via searching on google. Please be advised for future reference that you should search either online or within these forums before you go posting brand new threads. Thanks.

tur third 02-21-2011 07:25 AM

Definately go for an IDE - I would suggest Stani's SPE for an editor. Python is very unforgiving on spacing and syntax - so it will save you time.

If you are planning to program for fun, have a look at Pygame. This enables you to do graphical stuff with very little code.

sycamorex 02-21-2011 07:40 AM

Quote:

Originally Posted by corp769 (Post 4265310)
Read, read and read! That's the only way man...

I'll add to this:

Code, code and code!

slack-fu 02-21-2011 08:13 AM

Do a google search for 'python tutorial' and you will find more than you need.

soplin 02-21-2011 10:08 AM

Learn programming design. Beginners often ignore this important part. To design a program, try to express what you have in mind and put it on paper first in a way that others can understand it and then use this as the basis for commenting. You may use conventions like flow charts or uml.

Learn how to comment for that language.

Read but also play.

Start small with a basic hello world.
Learn the input, the output, the operators, condition statements, loops, the syntax in general and learn how you can use it.

Make a habit of adding a statement, compiling and running and if and only if it works move on to the next.
Try to make errors.
Learn to program in expanded form before programming in compressed form. Generally speaking expanded form is preferred because it is clearer to read.

Compressed form is like: afunction{y=(dothis(dothat(....)));}
Expanded form is like:

afunction
{
x = dothat();
y = dothis(x);
}

Learn the language's library but before using the library itself try creating the parts yourself.

Tinkster 02-21-2011 02:00 PM

Quote:

Originally Posted by soplin (Post 4265963)

Learn to program in expanded form before programming in compressed form. Generally speaking expanded form is preferred because it is clearer to read.

Compressed form is like: afunction{y=(dothis(dothat(....)));}
Expanded form is like:

afunction
{
x = dothat();
y = dothis(x);
}

Learn the language's library but before using the library itself try creating the parts yourself.

Python won't give you a choice there; spacing and layout is part
of the syntax.


Cheers,
Tink


P.S.: Moving this to programming.

dugan 02-21-2011 02:14 PM

http://www.linuxquestions.org/questi...python-860242/

dudeman41465 02-21-2011 02:29 PM

Here's a book you may find useful. It's available for free if you just Google it so I'm not violating anybody's copyright. Just read, write programs, experiment, and have fun. I use the default python IDE called IDLE, but it's very basic. It does syntax highlighting and highlights unclosed brackets, but that's about it. One thing it does allow you to do is to run a check on the whole file before you try running it to look for problems. You can find it in the python-tools package I believe.

Bagration 02-21-2011 07:24 PM

Learning Python ... how. I would ask why? I have to admit that I like Perl. But I would be glad if somebody could describe advantages of Python.

Of course I do understand that people who learned Python like it as I like perl.

Greetings B.

kurumi 02-21-2011 08:12 PM

Quote:

Originally Posted by Bagration (Post 4266673)
Learning Python ... how. I would ask why? I have to admit that I like Perl. But I would be glad if somebody could describe advantages of Python.

Of course I do understand that people who learned Python like it as I like perl.

Greetings B.

rather than asking someone to describe for you, why don't you sit down and try program with Python and see for yourself.?

Dogs 02-22-2011 01:15 AM

Python is awesome, man. Eclipse is a great IDE for python, but you'll want PyDev which you can get from sourceforge. Installation is easy, just extract the plugins and features folders to the root directory of eclipse, and then find the eclipse properties, locate the pydev list in the tree, and point the interpreter to the python binary.

From there, create files, name them something.py, and run them as python applications or whatever.


All times are GMT -5. The time now is 09:48 AM.