background preloader

Python

Facebook Twitter

Slide

We'll be connecting with OpenOffice.org through a separate process for now, since it's an easy place to begin. Before we do this, though, OpenOffice.org has to be listening for us. This involves passing a string to it when starting it up. Make sure that OpenOffice.org is completely closed (this includes closing OpenOffice.org from the system tray in Windows), and then open a console and change to the directory where OpenOffice.org is installed. Once there, change to the program directory. Now we'll open the OpenOffice.org Writer, passing a parameter that will allow OpenOffice.org to listen for a connection from us: $ . OpenOffice.org should open without any visible differences. The obvious first step here is to import the Python-UNO module, named uno: >>> import uno The first thing we must do is import a local component context.

Now we're left with defining what a service manager is. >>> local = uno.getComponentContext() Now we have a local component context. Apprendre à programmer avec Python/Classes, objets, attributs. Un livre de Wikilivres. À faire... Les chapitres précédents vous ont déjà mis en contact à plusieurs reprises avec la notion d'objet. Vous savez donc déjà qu'un objet est une entité que l'on construit par instanciation à partir d'une classe (c'est-à-dire en quelque sorte une « catégorie » ou un « type » d'objet).

Par exemple, on peut trouver dans la bibliothèque Tkinter, une classe Button() à partir de laquelle on peut créer dans une fenêtre un nombre quelconque de boutons. Nous allons à présent examiner comment vous pouvez vous-mêmes définir de nouvelles classes d'objets. Comme les objets de la vie courante, les objets informatiques peuvent être très simples ou très compliqués. Utilité des classes[modifier | modifier le wikicode] Les classes sont les principaux outils de la programmation orientée objet ou POO (Object Oriented Programming ou OOP en anglais). La dérivation est le mécanisme qui permet de construire une classe « enfant » au départ d'une classe « parente ». >>> p9 = Point() First step to Twitter OAuth & Streaming API using Python <<< $(YJL --verbose) Few days ago, I knew Basic Auth will be removed by June 30, 2010, Twitter even made a nice countdown timer. At the moment, I said “I'll be damned!”

To myself, because I simply didn't want to switch to OAuth for the scripts I am using. Alright, I admit that the real reason is I don't want to learn OAuth, yes, I still didn't know how OAuth works in behind. Anyway, it turned out I spent an hour to make one of my code to use OAuth with help from python-oauth2 library. Yes, I only took an hour to modify and believe or not, for 50 minutes, I was using wrong consumer key or secret. I somehow copy-and-paste them with some dust. Using python-oauth2 is pretty simple if you used to access Twitter API, then json.loads(content) on your own, read on. As for Streaming API, I would simply say it's an alternative way to search but more efficient because we keep-alive the connection. Twitter OAuth I am not going through OAuth because I didn't try to know it.

And this is how it post new status: Being Lazier? Se construire son outil de veille avec Yahoo Pipes, un petit guide)