×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    3

    Can you review my python files...?

    Hi from Spain.

    I'm developing a Python Web Browser [like Shotcuts] of my web.

    For Example,When I press in Foro [Forum],automatically the Browser of the phone will open in my web forum.

    The problem is that it doesn't work It doesn't open.
    I think it's problem of "Default.py" file but I don't know.....

    I show you my "default.py" file in Code & all files of the app.
    Can you tell me where is the error...?

    DOWNLOAD: http://www.mediafire.com/?e2nvqhwdwml

    Thanks

    Code:
    #xitopodo
    
    
    from appuifw import *
    import appuifw, e32
    
    xitopodo = [u"Foro",u"Hacks y Servicio Tecnico",u"Varios"]  
    index = appuifw.selection_list(xitopodo, 1)
    
    if index == 0:
       xitopodo = [u"Portal", u"Foro", u"Registrate", u"Descargas Symbian", u"Juegos Symbian", u"Zona GPS", u"Carbide TPC", u"Acerca de...", u"Salir"]
       index = appuifw.selection_list(xitopodo, 1)
       if index == 0:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http:/www.thephoneclub.com'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 1:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/index.php'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 2:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/register.php'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 3:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/descargas-symbian/'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 4:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/juegos/'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 5:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/zona-gps/'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 6:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/carbide-tpc/'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 7:
          appuifw.note(u"Aplicacion by xitopodo. Agradecimientos a TPC", "info")
       else:
          sys.exit()
    
    if index == 1:
       xitopodo = [u"Hacks", u"Dudas y Problemas Hacks", u"ST General", u"ST Software", u"ST Firmware", u"Software PC", u"Salir"]
       index = appuifw.selection_list(xitopodo, 1)
       if index == 0:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/hacks/'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 1:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/dudas-y-problemas-hacks/'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 2:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/general/'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 3:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/software/'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 4:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/firmware-sistema-operativo/'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 5:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/software-pc/'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       else:
          sys.exit()
    
    if index == 2:
       xitopodo = [u"Diseño Grafico", u"Buen Rollito", u"Operadores Telefonia", u"Zona Otras Marcas", u"Zona Iphone", u"Salir"]
       index = appuifw.selection_list(xitopodo, 1)
       elif index == 0:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/zona-diseno-grafico/'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 1:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/buen-rollito/'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 2:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/operadores-de-telefonia/'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 3:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/zona-otras-marcas/'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 4:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/zona-iphone/'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       else:
          sys.exit()

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

    Re: Can you review my python files...?

    hello xitopodo

    welcome to forum nokia python dibo.

    got your idea but it will be great if you tell the forum what errors you are facing in the script rather then giving all the code.

    Regards
    Gaba88

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

    Re: Can you review my python files...?

    hello xitopodo

    i spotted the error its a simple if/else error. The following code works fine for me check it.

    Code:
    # -*- coding: cp1252 -*-
    #xitopodo
    
    
    from appuifw import *
    import appuifw, e32
    
    xitopodo = [u"Foro",u"Hacks y Servicio Tecnico",u"Varios"]  
    index = appuifw.selection_list(xitopodo, 1)
    
    if index == 0:
       xitopodo = [u"Portal", u"Foro", u"Registrate", u"Descargas Symbian", u"Juegos Symbian", u"Zona GPS", u"Carbide TPC", u"Acerca de...", u"Salir"]
       index = appuifw.selection_list(xitopodo, 1)
       if index == 0:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http:/www.thephoneclub.com'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 1:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/index.php'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 2:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/register.php'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 3:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/descargas-symbian/'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 4:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/juegos/'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 5:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/zona-gps/'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 6:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/carbide-tpc/'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 7:
          appuifw.note(u"Aplicacion by xitopodo. Agradecimientos a TPC", "info")
       else:
          sys.exit()
    
    if index == 1:
       xitopodo = [u"Hacks", u"Dudas y Problemas Hacks", u"ST General", u"ST Software", u"ST Firmware", u"Software PC", u"Salir"]
       index = appuifw.selection_list(xitopodo, 1)
       if index == 0:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/hacks/'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 1:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/dudas-y-problemas-hacks/'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 2:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/general/'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 3:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/software/'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 4:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/firmware-sistema-operativo/'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 5:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/software-pc/'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       else:
          sys.exit()
    
    if index == 2:
       xitopodo = [u"Diseño Grafico", u"Buen Rollito", u"Operadores Telefonia", u"Zona Otras Marcas", u"Zona Iphone", u"Salir"]
       index = appuifw.selection_list(xitopodo, 1)
       if index == 0:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/zona-diseno-grafico/'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 1:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/buen-rollito/'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 2:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/operadores-de-telefonia/'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 3:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/zona-otras-marcas/'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       elif index == 4:
          apprun = 'z:\\system\\programs\\BrowserNG.exe'
          browser = 'z:\\System\\Apps\\Browser\\BrowserNG.app'
          url = 'http://www.thephoneclub.es/vbulletin/zona-iphone/'
          e32.start_exe(apprun, browser + ' "%s"' %url , 1)
       else:
          sys.exit()
    Hope this helps you.

    Enjoy Pythoning
    Gaba88

  4. #4
    Registered User
    Join Date
    Jun 2009
    Posts
    3

    Re: Can you review my python files...?

    gaba88

    Hi mate.
    I have 2 versions of this app.

    This version that I posted doesn't open when I pack & install in my phone. And,I think is a problem of the python file [code],or maybe,Is problem that some file like *.rsc.... [download]

    My second version have 3 files more than my fist version [launcher.py,lib.zip (with 2 files) and a .dll file) and I give this error:



    The .sis of my version is: http://www.mediafire.com/download.php?zjnfiwnyqk4



    EDIT:::: Thanks. Let's my try it

  5. #5
    Registered User
    Join Date
    Jun 2009
    Posts
    3

    Re: Can you review my python files...?

    Gaba88

    Thanks....!
    You're the man...! ^^

    It's works perfect

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

    Re: Can you review my python files...?

    Quote Originally Posted by xitopodo View Post
    Gaba88

    Thanks....!
    You're the man...! ^^

    It's works perfect
    hello xitopodo

    great that i was helful to you.

    The problem was very basic so i will advice you to go through the basic syntax issues in python.

    Regards
    Gaba88

  7. #7
    Regular Contributor
    Join Date
    Sep 2005
    Location
    Finland, Helsinki
    Posts
    323

    Re: Can you review my python files...?

    Hi xitopodo.
    Quote Originally Posted by xitopodo View Post
    I'm developing a Python Web Browser [like Shotcuts] of my web.
    You should really give a try for Python's "list" data structure and "list comprehension". It would save you lots of those if/else blocks.

    You should be able to paste the code below to a Python console to see what I mean.

    Code:
    # Create a data structure which contains categories and links
    xitopodo = [
        [u"Foro",[
            (u"Portal", 'http:/www.thephoneclub.com'), 
            (u"Foro", 'http://www.thephoneclub.es/vbulletin/index.php'), 
            (u"Registrate", 'http://www.thephoneclub.es/vbulletin/register.php'),
            # ...
        ]],
        [u"Hacks y Servicio Tecnico", [
            # ...
        ]],
        [u"Varios", [
            # ...
        ]],
    ]
    
    # Get all categories out from data
    [category[0] for category in xitopodo]
    # -> [u'Foro', u'Hacks y Servicio Tecnico', u'Varios']
    
    # Get out from data link names in the first category
    index = 0
    [link[0] for link in xitopodo[index][1]]
    # -> [u'Portal', u'Foro', u'Registrate']
    
    # Get out from data link URLs in the first category
    [link[1] for link in xitopodo[index][1]]
    # -> ['http:/www.thephoneclub.com', 'http://www.thephoneclub.es/vbulletin/index.php', 'http://www.thephoneclub.es/vbulletin/register.php']
    --
    Aapo Rista
    http://code.google.com/p/pys60gps/
    http://opennetmap.org/

Similar Threads

  1. Python for S60 1.9.3 released
    By tvijayan in forum Symbian
    Replies: 40
    Last Post: 2009-04-03, 15:00
  2. Replies: 1
    Last Post: 2009-03-12, 14:45
  3. nokia 6600,which python files to instal.
    By orange1949 in forum Symbian
    Replies: 3
    Last Post: 2008-03-25, 14: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
  •  
×