HaikuPorts
  • Login
  • Preferences
  • Help/Guide
  • Wiki
  • Timeline
  • Roadmap
  • View Tickets
  • Search
  • Port Log
  • Blog

Context Navigation

  • ← Previous Change
  • Wiki History
  • Next Change →

Changes between Version 2 and Version 3 of SandBox


Ignore:
Timestamp:
11/27/09 16:28:11 (6 years ago)
Author:
mmadia
Comment:

added a python example

Legend:

Unmodified
Added
Removed
Modified
  • SandBox

    v2 v3  
    7373loadfonts(screen, dir.Path()); 
    7474}}} 
     75 
     76== Python ==  
     77{{{ 
     78#!python 
     79#!/bin/env python 
     80 
     81import commands 
     82 
     83# Creating a utility function 
     84def FindDirectory(aDir): 
     85        result = commands.getoutput('finddir %s' % aDir) 
     86        return result 
     87         
     88 
     89if __name__ == "__main__": 
     90        # Using the utility function ... 
     91        B_APPS_DIRECTORY = FindDirectory('B_APPS_DIRECTORY') 
     92        print 'Using utility function:' 
     93        print B_APPS_DIRECTORY 
     94 
     95        # Set a baloney value, to display functionality 
     96        B_APPS_DIRECTORY='Some Text to display the value being set properly' 
     97        print 'After setting a baloney value:' 
     98        print B_APPS_DIRECTORY 
     99  
     100        # As a one liner ... 
     101        B_APPS_DIRECTORY = commands.getoutput('finddir B_APPS_DIRECTORY') 
     102        print 'Using a one liner:' 
     103        print B_APPS_DIRECTORY 
     104}}} 

Trac Powered

Powered by Trac 0.13dev-r10686
By Edgewall Software.

Visit the Trac open source project at
http://trac.edgewall.org/