You Are Here:

Community: Developer Discussion Boards

#1 Old Can you review my python files...? - 2009-06-28, 13:33

Join Date: Jun 2009
Posts: 3
xitopodo
Offline
Registered User
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()
Reply With Quote

#2 Old Re: Can you review my python files...? - 2009-06-28, 13:42

Join Date: Feb 2008
Posts: 2,543
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Online
Forum Nokia Champion
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


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Reply With Quote

#3 Old Re: Can you review my python files...? - 2009-06-28, 14:02

Join Date: Feb 2008
Posts: 2,543
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Online
Forum Nokia Champion
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


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Reply With Quote

#4 Old Re: Can you review my python files...? - 2009-06-28, 14:07

Join Date: Jun 2009
Posts: 3
xitopodo
Offline
Registered User
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:

http://i44.tinypic.com/iqg26f.jpg

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



EDIT:::: Thanks. Let's my try it
Reply With Quote

#5 Old Re: Can you review my python files...? - 2009-06-28, 14:35

Join Date: Jun 2009
Posts: 3
xitopodo
Offline
Registered User
Gaba88

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

It's works perfect
Reply With Quote

#6 Old Re: Can you review my python files...? - 2009-06-28, 15:20

Join Date: Feb 2008
Posts: 2,543
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Online
Forum Nokia Champion
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


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Reply With Quote

#7 Old Re: Can you review my python files...? - 2009-06-29, 10:49

Join Date: Sep 2005
Posts: 314
Location: Finland, Helsinki
aaaaapo
Offline
Regular Contributor
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/
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Python for S60 1.9.3 released tvijayan Python 40 2009-04-03 16:00
Ensymble / application packager, multiple script files + python uni concept project danburney999 Python 1 2009-03-12 15:45
nokia 6600,which python files to instal. orange1949 Python 3 2008-03-25 15:15

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia