Newbie help - Programming the Semantic Web with Python
bruce at whealton.info
Sun Jul 10 21:28:40 CEST 2011
Thanks for the tips. I actually had done some studies with Python, mainly
Python 3, back about 6 months ago and over a period of a few months.
I didn't write a great deal of programs though, at the time. I got away
from it in a while and I didn't want to go back to step one of being like a
total beginner. There are so many things I try to keep up with as a Web
Developer and coder and trying to expand my skills. Unfortunately, I don't
do well with picking a focus. I remember reading through this long
reference manual, called "Learning Python," while I was on a flight and over
a trip. That was without a computer, so I was just reading, which is not
the way to learn programming, obviously. I feel the many concepts will come
back to me fast. I have another text, called "Beginning Python: From Novice
to Professional" which covers Python 3. This is a bit more practical in
orientation. I'm debating whether to jump to the chapters dealing with the
web and see what I can do or starting from the beginning. I did look into
some online training, tutorials, or the like.
The Programming the Semantic Web book uses Python but all the code is
included. So, while it won't be a way to learn python, I hope I can get the
code to run correctly. In that text, they must be using Python 2.7 because
I see print statements and not the print function call.
If you know of any good resources for finding python applications on the
web, this might be a good way to learn. I don't know if I should look for
Python applications, or if I'll have more luck looking for Python Libraries.
From: Andrew Berg
Sent: Saturday, July 09, 2011 10:44 PM
Subject: Re: Newbie help - Programming the Semantic Web with Python
On 2011.07.09 08:32 PM, Bruce Whealton wrote:
> 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