As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
I am new to any scripting language. But, Still I worked on scripting a bit like tailoring other scripts to work for my purpose. For me, What is the best online resource to learn Python?
[Response Summary:]
Some Online Resources:
http://docs.python.org/tut/tut.html - Beginners
http://diveintopython3.ep.io/ - Intermediate
http://www.pythonchallenge.com/ - Expert Skills
http://docs.python.org/ - collection of all knowledge
Some more:
A Byte of Python.
Python 2.5 Quick Reference
Python Side bar
A Nice blog for beginners
Think Python: An Introduction to Software Design
If you need to learn python from scratch - you can start here: http://docs.python.org/tut/tut.html - good begginers guide
If you need to extend your knowledge - continue here http://diveintopython3.ep.io/ - good intermediate level book
If you need perfect skills - complete this http://www.pythonchallenge.com/ - outstanding and interesting challenge
And the perfect source of knowledge is http://docs.python.org/ - collection of all knowledge
If you're a beginner, try my book A Byte of Python.
If you're already experienced in programming, try Dive Into Python.
I think Python Challenge is great.
It's not about learning Python (syntax) but presents you small and fun riddles. Solving the riddles is based on Python but you can use whatever fits (your calculator, bash scripts, Perl...). After you solved one, you get to see how others have solved it and can discuss the pros & cons of the different ways.
Very nice to get a feel for how things could be done (smart) in Python. This site works especially well if you know a bit about other scripting languages or the commandline, etc.
The tutorial at Python's homepage is a good place to start. Also, there are some screencasts here.
These are unvaluable online reference tools:
Python 2.5 Quick Reference
Python Side bar
Other online resources for beginners:
A good python blog for beginners: http://www.learningpython.com/
Python Video at Google Code
Think Python: An Introduction to Software Design
The Python tutorial is actually pretty good.
There's also a video series on showmedo about python.
Between those two resources, you should have more than enough to learn the basics!
You can look at Building Skills in Python, also. It presumes some level of experience in programming.
If you're really new, try Building Skills in Programming. It includes a lot of background and fundamentals.
Google's Python Class
Welcome to Google's Python Class --
this is a free class for people with a
little bit of programming experience
who want to learn Python. The class
includes written materials, lecture
videos, and lots of code exercises to
practice Python coding. These
materials are used within Google to
introduce Python to people who have
just a little programming experience.
The first exercises work on basic
Python concepts like strings and
lists, building up to the later
exercises which are full programs
dealing with text files, processes,
and http connections. The class is
geared for people who have a little
bit of programming experience in some
language, enough to know what a
"variable" or "if statement" is.
Beyond that, you do not need to be an
expert programmer to use this
material.
There are some screencasts on http://showmedo.com
I learned from the Python Tutorial!
+1 for Dive Into Python
The python manual
Its a bit long winded sometimes but it tells you all you need to know to get going.
PLEAC , has a Python Cookbook , which is very helpful .
Learn Python in 10 minutes
The Cookbook is absolutely essestial if you want to know idiomatic python.
I consider ActiveState's Python community to be a great resource. Also
DZone Snippets can be useful.
I first ran across Software Carpentry looking at lists of python tutorials.. but its a lot more than a tutorial on python. turns out what I really learned was how to use subversion, and that none of my projects are better suited to python than to perl... yet.
Also consider [Hands-On Python](http://www.cs.luc.edu/~anh/python/hands- on/). It is used as a primary text for Computer Science 150 at Loyola University. It is concise intro to Python while emphasizing good programming style and design.
The Hazel Tree
Python Cookbook is very useful.
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
Ok so I know the basics of programming languages, I've studied python and liked it a lot. I'm studying now the intermediate parts of python and I'm catching the concepts already. I'm working with a project and at the same time solving computer problems that practices algorithm use. I've learned that python has limitations and wants to compensate that limitations by learning another programming language.
What programming language do you suggest that synergizes well with python? I want something who can give me their actual experience while working with python and the language that complements well with it. Answers like "try iron python or jython blah blah blah" won't help, if you can give me it's pros and cons, it's maturity it's problems then that's good enough for me... Thanks a lot
EDIT -
Sorry guys, I think I need to add some details in this. I'll be using python mainly for web programming or game development. So if you think this language A would help me in python for web programming then that's it.
What is wrong with IronPython or Jython? You can learn how to write libraries in Java or .Net to alleviate some of Python's speed problems. Learning to write your own Python libraries will certainly help you better understand and overcome the limitations you mentioned.
For me, the obvious choice to learn after Python is C. C is a lower level language, so you're dealing with more elemental computer concepts than objects, but it will give you the understanding necessary to write extensions to Python.
That way, it will be easy to write your programs in Python, and then migrate parts to C for speed--either by writing an extension or by using a bridge language like Cython.
If you run into performance problems (which might be an issue in game programming), C/C++ programs can be integrated well into Python scripts and vice versa:
Extending and Embedding
Python/C API
But I haven't yet seen the need to do so myself.
When you're quite comfortable with Python, Common Lisp and Scheme are good languages to learn about functional programming. I've been learning CLisp myself lately and there are a lot of "ahah!" moments that make it a lot of fun.
IronPython and Jython are great tools to learn if you plan on entering the professional world - there is tons of development right now in C# and Java - they're pretty much the hot languages of the professional world. IronPython integrates with all of the .NET languages, while Jython of course integrates with Java. So your choice there should reflect your desire to work at a .NET company, or not. Both IronPython and Jython are well matured languages.
Others have already mentioned C/C++ which are good choices if you're not familiar with them, and if ~30-40 years of programming life, and Top 3 rankings for July 2010 on the TIOBE index is not a strong enough reason to learn them... well you probably have other issues ;)
If you're looking at newer languages that haven't really been tested hard-core, you have languages like Ruby (which seems to be the new sexy), and Go by Google.
Perl is a bit like Ruby in that there is quite an overlap between Python and Ruby/Perl, and the areas they cover.
If I were to pick another language, already knowing Python, I'd go with a compiled language - maybe lower level like C\C++. I guess it really can be determined by what you want to do. If you want to work for a .NET company (which may or may not imply you really love Microsoft products), IronPython and a .NET language (C#, VB) is the way to go. OTOH, if you want to work for a company like Google (which happens to employ a certain individual), they extensively use Java and Python, so it's probably better to learn Jython.
I guess the question you need to ask yourself is, "Where do you I want to go today tomorrow?™"
Haskell or Ocaml, or maybe a Lisp dialect such as Common Lisp or Scheme.
I've started to learn Python and programming from scratch. I have not programmed before so it's a new experience. I do seem to grasp most of the concepts, from variables to definitions and modules. I still need to learn a lot more about what the different libraries and modules do and also I lack knowledge on OOP and classes in Python.
I see people who just program in Python like that's all they have ever done and I am still just coming to grips with it.
Is there a way, some tools, a logical methodology that would give me an overview or a good hold of how to handle programming problems ?
For instance, I'm trying to create a parser which we need at the office . I also need to create a spider that would collect links from various websites.
Is there a formidable way of studying the various modules to see what is needed ? Or is it just nose to the grind stone and understand what the documentation says ?
Sorry for the lengthy question..
The MIT Intro to Computer Science course on the MIT OpenCourseWare website was taught using Python. There are 24 lectures available as videos that you can watch for free.
It's kind of academic to be sure, but it would give you a very solid foundation to start from.
Start working your way through the Essential Python Reading List, which has articles on how to code in Python and how to do it well.
If you like a more academical approach try Learning Python from Mark Lutz.
For the use of standard libraries, the official docs are very good. More hands on descriptions can also be found in PYMOTW from Doug Hellmann
It might be useful to get some information on Object Oriented programming (just what is the whole class thing about, and how do you tell if your classes are good/poor/indifferent). Mark Lutz' book Learning Python has an entire Part (several chapters) on OO. If this stuff is new to you, it might be helpful to take a look. Two other books I have found quite useful: The Python Cookbook (Alex Martelli, a prolific contributor here), and the Python Essential Reference (David Beazley).
Just do your project, learning what you need to along the way. By the time you do that a couple times, you'll "get" it. And you'll only improve from there.
You can also read other peoples' code: download X that looks interesting and read through the code to understand how it works.
Those two tips will help you learn any language. Aside from that, Dive Into Python is a great resource for learning a lot about Python.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm cobbling together some sort of an introduction to Python, but one that focuses on the community and the ecosystem around Python rather than just the language. With How to Think Like a Computer Scientist and other great tutorials, it's easy to get familiar with the language, but it took me a fair while before I knew what The Cheese Shop, or, err, PyPi is about, how pip and virtualenv work and why you should use them, where you should go for help, the interesting blogs that you should follow, how your code should look (PEP 8, writing pythonic code) and so on. The 'soft stuff'.
What confused you the most when you just started out with Python? Are there certain things that you would've wanted to know about, or resources you wish you would have stumbled upon earlier than you did? People to know about?
I found a few similar questions on StackOverflow (e.g. here) but nothing really close to what I'd like to hear from you guys. Hope this question doesn't feel too subjective to your tastes :-)
(And, if you'd like to help out, feel free to send a message.)
I think one of the most important thing a beginner need to know about Python ecosystem is that it's a general purpose language surrounded by specialized libs. Experienced pythonistas know them, but a newbie can't:
Don't stop to tkinter : go wx, gtk or qt.
Don't dev web code by hands : use TurboGears, Pylons, Web.py or Django.
Don't parse HTML / XML with hard tools : use lxml or beautifulsoup.
Don't make syscall to imagemagik : use PIL.
Don't make advanced maths manually : use NumPy and SciPy.
Don't access simple databases by hand : use ORM like SQLAlchemy.
Don't reinvent sysadmin wheels : use Fabric.
etc.
The main ones should be listed in a book with guidances to choose among them.
"What confused you the most when you just started out with Python?"
Rule 2 of learning Python: Any general-purpose module or framework you think you want has already been written. Several times.
The hard part is realizing that your idea is
Not unique.
Been already improved upon before you even starting thinking about it.
Already posted somewhere.
So, code less and search more. Search widely and flexibly until you find things that are similar to what you want to do.
Realize that you might have a name you think is descriptive. But other folks may call it something different. Join the community, adopt their naming. You may not like the phrase "ORM", but that's what it's called.
Realize that your idea, no matter how sound it seems, may be really poor. When you find a framework that seems to have "needless extra features", you may be missing something from your idea.
Realize that your idea, no matter how "intuitive" it seems, may be really poor. When you find a framework that seems "counter-intuitive", the problem could be yours. Learn theirs first, then compare and contrast after you've mastered theirs. Until you've mastered theirs, keep searching and learning.
A few points related to the ecosystem and indirectly the community:
I wished I had been reminded more about the Batteries included. I think people should be told to print-out the Table of Contents of the Standard Library and keep it under their pillow, for frequent reviews (that advice, I finally took, several years into it, from an online intro/beginner's video presentation!). The [relative] stability, extensive but relevant content of the Std Lib speaks to the thoughtful governance of the community leaders and its beloved BDFL.
I think newcomers can also be "warned" (the word is maybe too strong, too unfair) about the extreme variety of PiPy. This reflects the vibrant, smart and diverse (in terms of background, domain of application, interests...) collective of users and contributors. This however can be overwhelming and possibly risky as all packages in there are not "prime time ready" (But many are and "saved my life" many times over).
Even if you feel too new to Python, don't only use the libraries, do peek under the hood! This is true of many languages, but maybe particularly of Python, there's much to be learned from perusing various source code. The reasons this may be particular true for Python are intrinsic to the language itself (multi-paradigms, hi level of abstraction...) but also because of the relative uniformity of coding (and architecting) style and because of the general level of collaboration within the community.
"What confused you the most when you just started out with Python?"
Rule 1 of learning Python: Use the Source, Luke.
There are question on SO asking for "good" source from which to learn Python. The best answers amount to "read the libraries that came with Python."
One can say that the libraries that come with Python are quirky. In places. Which makes them all the better for learning from.
There's a community of like-minded people who are not clones.
Open source software is the highest-quality software you'll ever get to work with, but it's not created by paid developers who will rigidly enforce standards.
explaining what a PEP is, how it is written and who wrote them, where we can find them. PEPs give a lot of background informations about a specific feature of the language. they also are the tool which shows how fast evolving python is.
(i wish i had read some PEPs earlier, but i was not really aware of them, although they are frequently linked in the manual)
From PEP 20:
import this
(aka, the Zen of Python)
developing a python package that can be installed with easy_install etc... I consider it equivalent to developing a jar or dll etc....
on the same token, developing said package(s) with virtualenv or buildout
If I would have known those things sooner, I would have probably used python for more than just scripting way back when I first started using it.
I've been programming Ruby pretty extensively for the past four years or so, and I'm extremely comfortable with the language. For no particular reason, I've decided to learn some Python this week. Is there a specific book, tutorial, or reference that would be well-suited to someone coming from a nearly-identical language, or should I just "Dive into Python"?
Thanks!
A safe bet is to just dive into python (skim through some tutorials that explain the syntax), and then get coding. The best way to learn any new language is to write code, lots of it. Your experience in Ruby will make it easy to pick up python's dynamic concepts (which might be harder to get used to for say a Java programmer).
Try a python tutorial or book on learning python.
After running through some tutorials on-line (the ones posted so far look pretty good), find a current Ruby project you've done (or are working on) and re-write it in Python. I've used this technique to transition from various languages, and it's helped enormously.
I started learning from the python tutorial. It is well written and easy to follow. Then I started to solve problems in python challenge. It was a really fun way to start :)
I suggest just diving into Python, it's similar to Ruby so you should have no problems:
http://www.diveintopython.net/
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I've gotten to grips with the basics of Python and I've got a small holiday which I want to use some of to learn a little more Python. The problem is that I have no idea what to learn or where to start. I'm primarily web development but in this case I don't know how much difference it will make.
Well, there are great ressources for advanced Python programming :
Dive Into Python (read it for free)
Online python cookbooks (e.g. here and there)
O'Reilly's Python Cookbook (see amazon)
A funny riddle game : Python Challenge
Here is a list of subjects you must master if you want to write "Python" on your resume :
list comprehensions
iterators and generators
decorators
They are what make Python such a cool language (with the standard library of course, that I keep discovering everyday).
Depending on exactly what you mean by "gotten to grips with the basics", I'd suggest reading through Dive Into Python and typing/executing all the chapter code, then get something like Programming Collective Intelligence and working through it - you'll learn python quite well, not to mention some quite excellent algorithms that'll come in handy to a web developer.
Something great to play around with, though not a project, is The Python Challenge. I've found it quite useful in improving my python skills, and it gives your brain a good workout at the same time.
I honestly loved the book Programming Python. It has a large assortment of small projects, most of which can be completed in an evening at a leisurely pace. They get you acquainted with most of the standard library and will likely hold your interest. Most importantly these small projects are actually useful in a "day to day" sense. The book pretty much only assumes you know and understand the bare essentials of Python as a language, rather than knowledge of it's huge API library.
I think you'll find it'll be well worth working through.
I'll plug Building Skills in Python. Plus, if you want something more challenging, Building Skills in OO Design is a rather large and complex series of exercises.
The Python Cookbook is absolutely essential if you want to master idiomatic Python. Besides, that's the book that made me fall in love with the language.
I'd suggest writing a non-trivial webapp using either Django or Pylons, something that does some number crunching.
No better way to learn a new language than commiting yourself to a problem and learning as you go!
Write a web app, likely in Django - the docs will teach you a lot of good Python style.
Use some of the popular libraries like Pygments or the Universal Feed Parser. Both of these make extremely useful functions, which are hard to get right, available in a well-documented API.
In general, I'd stay away from libs that aren't well documented -
you'll bang your head on the wall trying to reverse-engineer them -
and libraries that are wrappers around C libraries, if you don't have
any C experience. I worked on wxPython code when I was still learning
Python, which was my first language, and at the time it was little
more than a wrapper around wxWidgets. That code was easily the ugliest
I've ever written.
I didn't get that much out of Dive Into Python, except for the dynamic import chapter - that's not really well-documented elsewhere.
People tend to say something along the lines of "The best way to learn is by doing" but I've always found that unless you're specifically learning a language to contribute to some project it's difficult to actually find little problems to tackle to keep yourself going.
A good solution to this is Project Euler, which has a list of various programming\mathematics challenges ranging from simple to quite brain-taxing. As an example, the first challenge is:
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
And by problem #50 it's already getting a little tougher
Which prime, below one-million, can be written as the sum of the most consecutive primes
There are 208 in total, but I think some new ones get added here and there.
While I already knew python fairly well before starting Project Euler, I found that I learned some cool tricks purely through using the language so much. Good luck!
Search "Alex Martelli", "Alex Martelli patterns" and "Thomas Wouters" on Google video. There's plenty of interesting talks on advanced Python, design patterns in Python, and so on.