You Are Here:

Community: Developer Discussion Boards

#1 Old Thumbs up Use python to understand Symbian OS features - 2005-08-14, 01:26

Join Date: Feb 2005
Posts: 1,353
Location: Belgium (Europe)
cyke64's Avatar
cyke64
Offline
Super Contributor
Pymbian http://pymbian.sourceforge.net/ is designed to be a pedagogical device, helping to understand underlying principles of Symbian OS. It enables programmer to use regular Python to implement prototypes using Symbian C++ programming paradigms.

Specially, it models following features of Symbian OS:

* Threads, Timers, Semaphores
* Low-level asynchronous services (thread request semaphores, request status signaling & waiting, etc)
* High-level asynchronous service (active schedulers and active objects)
* client/server framework

download : http://sourceforge.net/project/showf...roup_id=143316

source example : This source file shows how Active Scheduler, Active Object and platform timer service is used:

Code:
import sys
import thread
import time

from pymbian.base import CActiveScheduler, CActive
from pymbian.std import KErrNone, User, RThread, KRequestPending, RTimer
from pymbian.std import KErrCancel

def do_example():
    print "starting example"

    scheduler = CActiveScheduler()
    CActiveScheduler.Install(scheduler)

    ao = TestAO()
    ao.IssueRequest()

    scheduler.Start()

    print "closing down example"

class TestAO(CActive):
    def __init__(self):
        CActive.__init__(self)
        CActiveScheduler.Add(self)        
        self.service = RTimer()

    def IssueRequest(self):
        print "issuing request for 1 sec delay"
        self.service.After(self.iStatus, 1)
        self.SetActive()

    def Run(self):
        print "TestAO.Run called"
        print "closing down activescheduler"
        CActiveScheduler.Stop()

    def DoCancel(self):
        self.service.Cancel()


def main():
    do_example()

if __name__ == "__main__":
    main()
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia