You Are Here:

Community: Developer Discussion Boards

#1 Old python Bartending - 2008-05-15, 23:57

Join Date: May 2008
Posts: 1
froboi
Offline
Registered User
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.
Reply With Quote

#2 Old Re: python Bartending - 2008-05-16, 05:22

Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
Offline
Forum Nokia Champion
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
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
Please help installing Python libraries on S60 ericroijen Python 11 2009-07-18 11:43
[announce] PyUIQ. Python for UIQ 2.1 and 3.x OscarBernabeu Python 35 2008-01-17 10:12
[announce] the first Mobile Python book is now available ! cyke64 Python 1 2008-01-08 10:58
[announce] Mobile Python book soon in Sept 2007 ! cyke64 Python 11 2007-10-03 20:46
[announce] Lightblue - cross-platform Python Bluetooth API buzz111 Python 32 2007-07-19 08:43

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