On Fri, Apr 8, 2011 at 12:58 PM, Nor Arlina Amirah Ahmad Ghani
<[email protected]> wrote:
> I see API as a sort of library that can be used during our project
> development. If I want a certain function to work on my project, I still
> refer to the API and use the packages available. Is this a good reflection
> of what API is? How do you people use API?

Don't bother too much about what it's really mean, you'll learn about
it and what it really mean in various context along the way. For now,
it's enough to assume it as something that you can 'call' either:-

natively through your language:-

import twitter
timelines = twitter.get_public_timeline()

using tools/library provided by your language:-

import urllib
timelines = 
urllib.urlopen('http://api.twitter.com/version/statuses/public_timeline.json').read()

or if you desperate enough, using os system call provided by your language:-

import os
output = os.system('curl
http://api.twitter.com/version/statuses/public_timeline.json')

also, as Boh pointed out there's certain cases when using API means
you need to have your code in certain way or exists at certain
location rather than you 'call' the 'API'. Example, the 'API' require
you to place you code under directory named
/yourproject/controller/index.py and you must have a class named
IndexController inside that file. This is just example, none of modern
Python framework nowadays is that silly anymore ;)

-- 
To unsubscribe from and detail about this group 
http://portal.mosc.my/osdc-my-mailing-list-information

MOSC2011 http://fb.me/mosc2011 and http://portal.mosc.my/

Kirim email ke