Thread Closed

Programming in Python

 
Share Thread Thread Tools
Apr8-09, 08:03 PM   #1
 

Programming in Python


I am new to computer programming, but if anyone familiar with Python has any suggestions or resources for a beginner, I would appreciate it.

How useful is programming in Python? How does it compare to other programming languages?

I've also heard that Python is relatively simple to learn; is this true in your experience?

Thanks for your responses!
 
PhysOrg.com
PhysOrg
science news on PhysOrg.com

>> Heat-related deaths in Manhattan projected to rise
>> Dire outlook despite global warming 'pause': study
>> Sea level influenced tropical climate during the last ice age
Apr8-09, 11:01 PM   #2

Homework Helper 2012
 
Recognitions:
Homework Helper Homework Help
Science Advisor Science Advisor
Yes, it is simple to learn. And it's extremely powerful and coherent. Find out for yourself. Just learn it. There are endless numbers of tutorials and websites. Start learning how to use the objects and inheritance sooner rather than later, that's my advice. It will change your life.
 
Apr8-09, 11:06 PM   #3
 
Quote by Dick View Post
Yes, it is simple to learn. And it's extremely powerful and coherent. Find out for yourself. Just learn it. There are endless numbers of tutorials and websites. Start learning how to use the objects and inheritance sooner rather than later, that's my advice. It will change your life.
Hmm... Learn how to use objects and inheritance sooner rather than later... some good advice, I'm sure. =)

I appreciate your response, and will look into the tutorials soon. Thanks!
 
Apr9-09, 10:48 AM   #4
 
Recognitions:
Homework Helper Homework Help
Science Advisor Science Advisor

Programming in Python


Start here http://diveintopython.org/
And possibly here http://www.greenteapress.com/thinkpython/ (there is a link to a free version of the book)
For science stuff checkout scipy http://www.scipy.org/

The nice thing about python is you can do procedural/object orientated or functional programming depending on the problem.
 
Apr9-09, 10:55 AM   #5
 
Blog Entries: 14
http://www.python.org/doc/

some google fun:
http://code.google.com/
http://code.google.com/apis/calendar...de_python.html

I don't know python but I can use google python api and make things out of it.
 
Apr9-09, 12:32 PM   #6
 
Thank you all very much -- I have already begun checking out the links, and I can't wait to dive into some applications.
 
Apr9-09, 02:16 PM   #7
 
Blog Entries: 47
Recognitions:
Gold Membership Gold Member
Homework Helper Homework Help
Science Advisor Science Advisor
http://vpython.org/

http://www.google.com/search?q=vpython
 
Apr9-09, 06:06 PM   #8
 
People, try harder. This is bad advice you're giving out.

Quote by Dick View Post
Start learning how to use the objects and inheritance sooner rather than later, that's my advice. It will change your life.
No, someone new to programming has no use for object oriented programming. Simple, small programs really are sequences of commands (imperative statements) - procedural, or maybe functional, styles are most natural for this. OOP is an unnecessary distraction for the new programmer. It distracts from far more fundamental issues - for instance, variable scoping, typing, procedures/functions, organizing code without objects...

Quote by mgb_phys View Post
Quote by Mark Pilgrim
Dive Into Python is a Python book for experienced programmers.
 
Apr9-09, 06:14 PM   #9
 
Quote by science.girl View Post
I am new to computer programming, but if anyone familiar with Python has any suggestions or resources for a beginner, I would appreciate it.

How useful is programming in Python? How does it compare to other programming languages?

I've also heard that Python is relatively simple to learn; is this true in your experience?

Thanks for your responses!
Yes, Python is probably the best language to start with. It is very easy to learn. It is also very useful - it is very popular, and has lots of very good third-party libraries (as mentioned here, you have SciPy for numerical work, and vPython for basic graphics...)

Another important point is that you can program interactively, with an interpreter executing your code in real time - this is extremely good for experimentation and learning. You can examine objects and variables interactively too. You'll quickly see how useful this is.

One very useful reference is the official docs for Python libraries,

http://docs.python.org/library/

I'm sorry I'm not sure which introductory books are good right now.
 
Apr9-09, 06:41 PM   #10
 
Quote by signerror View Post
Yes, Python is probably the best language to start with. It is very easy to learn. It is also very useful - it is very popular, and has lots of very good third-party libraries (as mentioned here, you have SciPy for numerical work, and vPython for basic graphics...)

Another important point is that you can program interactively, with an interpreter executing your code in real time - this is extremely good for experimentation and learning. You can examine objects and variables interactively too. You'll quickly see how useful this is.

One very useful reference is the official docs for Python libraries,

http://docs.python.org/library/

I'm sorry I'm not sure which introductory books are good right now.
Thank you very much, Signerror. Will follow your suggestions.
 
Apr9-09, 07:18 PM   #11
 
Recognitions:
Homework Helper Homework Help
Science Advisor Science Advisor
Sorry I had forgotten that dive into wasn't for new programmers.
Thinking like a computer scientist in python is - it's aimed at high school students
Free online version here http://openbookproject.net//thinkCSpy/
 
Apr9-09, 09:50 PM   #12

Homework Helper 2012
 
Recognitions:
Homework Helper Homework Help
Science Advisor Science Advisor
Quote by signerror View Post
People, try harder. This is bad advice you're giving out.



No, someone new to programming has no use for object oriented programming. Simple, small programs really are sequences of commands (imperative statements) - procedural, or maybe functional, styles are most natural for this. OOP is an unnecessary distraction for the new programmer. It distracts from far more fundamental issues - for instance, variable scoping, typing, procedures/functions, organizing code without objects...
Really gotta disagree with you there, signerror. Unlike some other languages I could name, objects are not an 'add-on' in Python. They ARE the language. The rest of those concepts are the 'distractions'. That's what you learn when you've finally really gotten Python. Even a small program is more efficiently and flexibly structured as an object. It just fits. It's easy to start off in Python by emulating styles from other languages, which you can do, but when you finally get it, you realize that was wrong.
 
Apr9-09, 10:12 PM   #13
 
I, for one, think that it's true one should start without objects, but...
You should get there as soon as possible. Realistically, you should be comfortable with data types, branching, loops, and functions before you really start trying to use objects. Then, you should get good with using simple objects before using inheritance, polymorphism, etc.

It would be a shame for anybody to learn to program nowadays without learning OO programming. I doubt anybody starts off learning by writing fully OO programs. People start off writing procedural code in an OO language.
 
Apr9-09, 10:21 PM   #14

Homework Helper 2012
 
Recognitions:
Homework Helper Homework Help
Science Advisor Science Advisor
Sure they do. I couldn't agree more. I started by writing convoluted code using procedures and rearranging lists, coming from writing a lot of mathematica. My mistake. Feel free to start that way. There's probably a lot of other ways to make fundamental design errors. I'm just saying that the sooner you get beyond that the sooner you realize what a bad idea that was.
 
Apr11-09, 02:47 PM   #15
 
I'm new too, and this has helped me a lot get my foot in the door.
http://pythonbook.coffeeghost.net/
 
Apr11-09, 11:46 PM   #16
 
Recognitions:
Gold Membership Gold Member
I'm really tired of hearing all the hype about OOP. Maybe it's a good paradigm for some situations. And maybe it works well for some programmers. But I have a hard time accepting that it is the "be all end all" of programming. I've been programming for over 30 years (assembly for (Z80, 8086, various micro-controllers), basic, vb.net, java, PHP and c#). And after hearing all the hype, and after trying it myself, and after not being able to "get" why it's better than procedural methods, it was nice to come across at least one other person that was not so "gung ho" about it.

http://www.geocities.com/tablizer/oopbad.htm
 
Apr12-09, 02:30 AM   #17
 
I write python for personal use, and I rarely feel the need to define my own classes. My code is just a bunch of functions that operate on simple data. If I need a data structure that has three or four properties, most likely I'll just use a list or tuple instead of an object--the tuple is more convenient. Also, frequently it's simpler to pass a function as an argument to my function, instead of using polymorphism. If I NEED object oriented features because my objects have so many properties that I need to name them to keep track of them, then I'll define a class, but on small personal projects of a few hundred lines or less, this doesn't happen much.

I've done all the object oriented stuff in Java, too, plus I've cut my teeth on an armful of other languages. I just find functions to usually be a more convenient way of structuring code, at least on small personal projects.
 
Thread Closed

Tags
python
Thread Tools


Similar Threads for: Programming in Python
Thread Forum Replies
Compile Python, Matlab and Python Programming & Comp Sci 3
help in Python rk4 Programming & Comp Sci 1
[B]Problem statement:[/B]If you have a list, how do you count the Engineering, Comp Sci, & Technology Homework 2
GTK and Python Programming & Comp Sci 2
Python rk4 Programming & Comp Sci 0