×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    5

    threading module

    how do i get the threading module working on my phone?
    in PythonForS60_1_4_0_doc.pdf i found, it is working but not shipped. i tried to copy a threading.py from python-2.2.* to e:\python, but i could not import it...
    but i found some examples using threading.
    for now i wrote a simple Thread class using the thread module. but having threading working would be more comfortable.

  2. #2
    Registered User
    Join Date
    Feb 2005
    Location
    Belgium (Europe)
    Posts
    1,352

    Re: threading module

    Quote Originally Posted by flx013 View Post
    how do i get the threading module working on my phone?
    in PythonForS60_1_4_0_doc.pdf i found, it is working but not shipped. i tried to copy a threading.py from python-2.2.* to e:\python, but i could not import it...
    but i found some examples using threading.
    for now i wrote a simple Thread class using the thread module. but having threading working would be more comfortable.
    If sys.path doesn't conrain e:\python path it can't find it !
    It's more convenient to put .py modules in c:\resource folder.
    But c:\resource is read only so you MUST use a sis file to install this threading.py in it !

    Install ensymble.
    now create a folder threading and in threading make a new folder resource and put your file in resource !

    threading
    |
    |
    resource
    |
    |
    threading.py

    Code:
    ensymble simplesis threading
    Now you can install threading_v1_0_0.sisx to your phone.

    BR
    Cyke64
    pys60 1.4.5 and 2.0.0, pygame, PyS60 CE on E90 and 5800 !

    Find my pys60 extension modules on cyke64.googlepages.com

  3. #3
    Registered User
    Join Date
    Feb 2005
    Location
    Belgium (Europe)
    Posts
    1,352

    Re: threading module

    hello again ,

    There's also another solution.
    Add the e:\python\lib path or c:\python\lib to sys.path like this :
    Code:
    import sys
    sys.path.append('e:\\python\\lib')
    # put threading.py in e:\python\lib !
    Now you can directly copy ANY python source file (.py) without first sis file installing !

    BR
    Cyke64
    pys60 1.4.5 and 2.0.0, pygame, PyS60 CE on E90 and 5800 !

    Find my pys60 extension modules on cyke64.googlepages.com

  4. #4
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    153

    Re: threading module

    Does anyone has experiences on using the threading module on pys60 already?

    Are there any drawbacks or incompatibilities?

    Is there another reason why this module was never implemented in any pys60 release?

    cheers
    novis

  5. #5
    Regular Contributor
    Join Date
    Jan 2004
    Location
    Helsinki
    Posts
    376

    Re: threading module

    Quote Originally Posted by novis View Post
    Does anyone has experiences on using the threading module on pys60 already?

    Are there any drawbacks or incompatibilities?

    Is there another reason why this module was never implemented in any pys60 release?

    cheers
    novis
    I am not sure, but threading might be post-Python-version-2.2 module.
    Mikko Ohtamaa

    http://mfabrik.com
    http://blog.mfabrik.com

  6. #6
    Registered User
    Join Date
    Mar 2008
    Posts
    20

    Re: threading module

    I have the following code and copied threading.py and and traceback.py to e:\python\lin
    ---
    import sys
    sys.path.append('e:\\python\\lib')
    import threading

    class GPSThread(threading.Thread):
    "A class provifing GPS functionality"
    def run(self):
    console.update(u'Waiting For GPS Fix...')
    positioning.set_requestors([{"type":"service", "format":"application", "data":"test_app"}])
    cb(positioning.position(course=1,satellites=1))
    console.update(u'GPS Fix Obtained')

    GPSThread.start()
    ---

    Which returns the error

    AttributeError: 'module' object has no attribute 'Thread'

    Any ideas on how to get threading working here or am i missing something?

  7. #7
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: threading module

    hi danieb_za
    there must be a syntax error in your code thats why its showing that kind of error plz check in detail.
    And plz post your code using the quotes provided.
    thanks

  8. #8
    Regular Contributor
    Join Date
    Jan 2004
    Location
    Helsinki
    Posts
    376

    Re: threading module

    AttributeError: 'module' object has no attribute 'Thread'

    Any ideas on how to get threading working here or am i missing something?
    try thread.start_thread(function_name, parameters)

    PyS60 has some custom threading magic and all standard Python features are not available. See PyS60 api doc. threading section.

    Also, GPS callbacks and state settings work only in the main thread.
    Mikko Ohtamaa

    http://mfabrik.com
    http://blog.mfabrik.com

  9. #9
    Registered User
    Join Date
    Mar 2008
    Posts
    20

    Re: threading module

    Gaba88,

    I don't have syntax errors, i have checked this properly.

    I'm using the low-level thread module now and it seems to be working.

  10. #10
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: threading module

    Quote Originally Posted by danieb_za View Post
    Gaba88,

    I don't have syntax errors, i have checked this properly.

    I'm using the low-level thread module now and it seems to be working.
    hi danieb_za
    thanks for the feedback.

Similar Threads

  1. ImportError: No module named _appuifw
    By ernesto.ferrari in forum Mobile Web Server
    Replies: 9
    Last Post: 2008-04-18, 05:36
  2. Carbide.j 1.5 and Netbeans 5.5 beta 2
    By ovjo12 in forum Mobile Java Tools & SDKs
    Replies: 5
    Last Post: 2007-06-11, 05:43
  3. [announce] Enhanced Graphics module
    By GameDude in forum Symbian
    Replies: 10
    Last Post: 2007-03-18, 18:44
  4. Carbide J, Nokia Designers module error!!!
    By rolecram in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2007-02-15, 23:17
  5. SMS I/O Control Application via Evaluation Module
    By alokghosh in forum Nokia M2M
    Replies: 2
    Last Post: 2003-06-18, 17:05

Posting Permissions

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