×

Discussion Board

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

    python Bartending

    OK so heres the problem I'm facing. I am trying to make a program that takes a lit of ingredients that you enter into a field and it processes them and spits back out a list of drinks you can make. I can't seem to figure out how to make the search function work. If anyone has any ideas on how to make this work please! Please! dont hold them back. Also, I am somewhat new to python so if you could give a general breakdown of the script it would save me alot of time.

  2. #2
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: python Bartending

    Hi and welcome to the Forum.

    From what I understand you want to have a list of ingredients with the ability to search for specific ones in the list. If so, you could use a selection list:
    Code:
    import appuifw, e32
    
    #Define the exit function and assign it to the right softkey
    def quit():app_lock.signal()
    appuifw.app.exit_key_handler=quit
    
    #First create the sequence of ingredients (must be unicode)
    a=[u"Alcohol",u"Water",u"Vodka",u"Lemon juice"]
    
    #Now display the list and store the index of the selected option in a variable (i, for example)
    i=appuifw.selection_list(a, search_field=1)
    
    #You can store the ingredient in a new list, for processing and generating the drink name
    b=[]
    b.append(a[i])
    
    app_lock=e32.Ao_lock()
    app_lock.wait()
    The example above is good for choosing one ingredient

    Hope that helps

Similar Threads

  1. Please help installing Python libraries on S60
    By ericroijen in forum Symbian
    Replies: 11
    Last Post: 2009-07-18, 10:43
  2. [announce] PyUIQ. Python for UIQ 2.1 and 3.x
    By OscarBernabeu in forum Symbian
    Replies: 35
    Last Post: 2008-01-17, 09:12
  3. Replies: 1
    Last Post: 2008-01-08, 09:58
  4. Replies: 11
    Last Post: 2007-10-03, 19:46
  5. Replies: 32
    Last Post: 2007-07-19, 07:43

Posting Permissions

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