×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    May 2011
    Posts
    9

    can you help me convert this s60v5 python script to run in pc

    import e32
    import appuifw
    from socket import *

    quit_signal = e32.Ao_lock()
    app = appuifw.app
    old_handlers = app.menu, app.exit_key_handler, app.body, app.title

    def on_exit():
    app.menu, app.exit_key_handler, app.body, app.title = old_handlers
    quit_signal.signal()

    app.exit_key_handler = on_exit
    tb = appuifw.Text()
    app.body = None
    app.menu = []
    app.title = u"RFCOMM server"

    sock = socket(AF_BT, SOCK_STREAM)
    port = bt_rfcomm_get_available_server_channel(sock)
    sock.bind(("", port))
    set_security(sock, AUTHOR)
    sock.listen(1)
    bt_advertise_service(u"SampleServer", sock, True, RFCOMM)

    tb.add( u"listening on port ", port )
    client, addr = sock.accept()
    tb.add( u"accepted connection from ", addr )
    appuifw.note(u"accepted connection", "info")
    sock.close()

    client.send("Series 60 Python server says Hello!!")
    data = client.recv(80)
    tb.add( u"received: ", data )
    client.close()

    quit_signal.wait()

  2. #2
    Nokia Developer Expert
    Join Date
    Sep 2011
    Posts
    382

    Re: can you help me convert this s60v5 python script to run in pc

    One way would be to change the appuifw with PyQT and using PyBluez for the Bluetooth server.

Similar Threads

  1. Is Python s60v5 different from s60v3 ?
    By writ-z in forum Symbian
    Replies: 1
    Last Post: 2011-04-25, 09:14
  2. Replies: 2
    Last Post: 2011-01-17, 08:06
  3. Replies: 4
    Last Post: 2009-08-06, 18:09
  4. Can a Python script call a Perl script?
    By xhsoldier in forum Symbian
    Replies: 1
    Last Post: 2009-02-11, 10:04
  5. How to run my python script?
    By Gowtham_India in forum Symbian
    Replies: 2
    Last Post: 2007-06-25, 10:15

Posting Permissions

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