×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Aug 2007
    Posts
    23

    Question get name of script file

    Is there an elegant way of getting the name of a running PyS60 script like with "__file__" in regular python? I have this work around which I don't consider elegant:

    def get_script_path():
    import traceback
    try:
    return __file__
    except:
    # workaround for __file__ not supported by PyS60
    s = traceback.format_exc()
    s = s.split('File')[1].split(',')[0]
    return s.strip(' "')

    if __name__ == '__main__':
    print "script = ", get_script_path()

  2. #2
    (Retired) Nokia Developer Admin.
    Join Date
    Jan 2006
    Location
    Michigan
    Posts
    4,664

    Re: get name of script file

    Closed No Reply

Similar Threads

  1. How to get All the file name of Device?
    By saniat.rasel in forum Symbian
    Replies: 1
    Last Post: 2009-05-11, 13:28
  2. How to get the file name of the content?
    By sathish4urs in forum Digital Rights Management & Content Downloading
    Replies: 0
    Last Post: 2008-11-13, 09:50
  3. Replies: 1
    Last Post: 2006-10-05, 12:33
  4. Finding name of the main script ...
    By cyke64 in forum Symbian
    Replies: 1
    Last Post: 2006-01-10, 11:39
  5. Replies: 1
    Last Post: 2003-04-22, 13:56

Posting Permissions

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