Diff for "API/Examples"

Not logged in - Log In / Register

Differences between revisions 3 and 4
Revision 3 as of 2009-11-25 12:59:47
Size: 888
Editor: 20-159-126-200
Comment: simplified the first example
Revision 4 as of 2009-11-25 13:00:58
Size: 891
Editor: 20-159-126-200
Comment:
Deletions are marked like this. Additions are marked like this.
Line 21: Line 21:
The `hello-world` bit is the name of the application, `production` means connect to the production server. The `hello-world` bit is the name of the application and `production` means connect to the production server.

Launchpad Help > API > Examples

This page has a bunch of examples of how to use launchpadlib and the Python APIs. Think of it like a cookbook that you can add your favourite recipe to.

If this duplicates launchpadlib too much, then please merge the two pages.

Hello Launchpad!

Ever wanted to have Launchpad greet you by your own name? Now you can, in the comfort of your own home.

   1 from launchpadlib.launchpad import Launchpad
   2 launchpad = Launchpad.login_with(
   3     'hello-world', 'production')
   4 print 'Hello, %s!' % launchpad.me.display_name

The hello-world bit is the name of the application and production means connect to the production server.

API/Examples (last edited 2016-04-15 18:13:29 by cjwatson)