Newbie help - Programming the Semantic Web with Python

Andrew Berg bahamutzero8825 at gmail.com
Sat Jul 9 22:44:47 EDT 2011


On 2011.07.09 08:32 PM, Bruce Whealton wrote:
> Hello,
>             So, I got this book on Programming the Semantic Web about
> the same time I started learning Python.  The code seems to be
> developed for python 2.7 and not 3, I believe.
If you're going to learn Python 3, I suggest learning from a book that
deals with Python 3 (if there's not an updated text for the area you're
dealing with, go with something that teaches the basics). Once you have
the basics down and you know the common differences, then it will be
much easier to learn from a text that's based on Python 2 (you'll
stumble a whole lot less when trying to learn from such texts). You'll
also find some things in Python 3 that have been added to recent
versions of Python 2 that the text may not cover (e.g., the old % string
formatting syntax vs. the new format() string method).
> If I was using python 3, it would require () around the thing that is
> going to be printed, right?
That's not really the right way to think of the print() function. The
print statement has some very arbitrary syntax that could cause
unexpected behavior if simply put in the print() function. The print
function has parameters for optional behavior rather than odd syntax. In
the simplest cases, print and print() are extremely similar, but print()
has a bunch of functionality that is either difficult/annoying to
decipher (for humans, not the interpreter) or simply doesn't exist in print.



More information about the Python-list mailing list