×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Sep 2010
    Posts
    21

    this code shows some error

    import appuifw, e32, location, time, os.path
    PATH = u"E:\\Data\\gsm_loca\\"
    if not os.path.exists(PATH):
    os.makedirs(PATH)
    INTERVAL = 5.0
    CELL_FILE = PATH + "known_cells.txt"
    LOG_FILE = PATH + "visited_cells.txt"
    log = file(LOG_FILE, "a")
    timer = e32.Ao_timer()
    def current_location():
    int gsm_loc = location.gsm_location()
    return "%d/%d/%d/%d" % int(gsm_loc)def show_location():
    loc = current_location()
    if loc in known_cells:
    here = known_cells[loc]
    print "You are currently at", here
    else:
    here = ""
    print "Unknown location", loc
    print >> log, time.ctime(), loc, here
    timer.after(INTERVAL, show_location)
    def name_location():
    loc = current_location()
    name = appuifw.query(u"Name this location", "text")
    if name:
    known_cells[loc] = name
    def load_cells():
    global known_cells
    try:
    known_cells = load_dictionary(CELL_FILE)
    except:
    known_cells = {}
    def quit():
    print "SAVING LOCATIONS TO", CELL_FILE
    save_dictionary(CELL_FILE, known_cells)
    print "GSM LOCATIONING APP EXITS"
    timer.cancel()
    log.close()
    app_lock.signal()
    appuifw.app.exit_key_handler = quit
    appuifw.app.title = u"GSM location App"
    appuifw.app.menu = [(u"Name this location", name_location)]

    print "RECORDING VISITED CELLS TO", LOG_FILE
    print "LOADING LOCATIONS FROM", CELL_FILE
    load_cells()
    print "%d KNOWN CELLS LOADED" % len(known_cells)
    show_location()

    print "GSM LOCATIONING APP STARTED"
    app_lock = e32.Ao_lock()
    app_lock.wait()






    this code shows some error

    return "%d/%d/%d/%d" % int(gsm_loc)

    TypeError

    i am not able to run this file can u plz help me to run it
    i am using nokia 5800

  2. #2
    Nokia Developer Moderator
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: this code shows some error

    Please use the code tags (the button with the # symbol on it in the post editor in Advanced mode) when posting code, as that will keep indentation. Without indentation it's very, very hard to read Python code. Also, is that the complete error message?

Similar Threads

  1. what is error of this Code
    By cescholarship in forum Mobile Java General
    Replies: 0
    Last Post: 2010-11-16, 15:27
  2. Replies: 2
    Last Post: 2008-07-30, 09:21
  3. what is the error in this code............
    By amrish20 in forum Symbian Media (Closed)
    Replies: 3
    Last Post: 2008-06-12, 15:00
  4. Replies: 0
    Last Post: 2008-03-02, 18:44
  5. newbie: a possible logical error in this code!
    By doesitmatter in forum Symbian C++
    Replies: 8
    Last Post: 2006-06-14, 12:40

Posting Permissions

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