Re: [Tutor] Custom Function that Takes argument

2015-10-31 Thread Nym City via Tutor
Hello, Thank you for your response. I went back and updated encoding to utf-8 and ASCII but I still experienced issues with the output. The part that is interesting is that the output for each of the following fields is the (should be) the same    1.Search by City     2.Search by Region (State Ab

Re: [Tutor] Custom Function that Takes argument

2015-10-21 Thread Alan Gauld
On 21/10/15 01:18, Nym City via Tutor wrote: def zip_search(query): api_key = locu_api url = 'https://api.locu.com/v1_0/venue/search/?api_key=' + api_key zip = query.replace(' ', '%20') final_url = url + '&zip=' + zip + "&category=restaurant" jason_obj = urllib2.urlopen(

Re: [Tutor] Custom Function that Takes argument

2015-10-21 Thread Nym City via Tutor
Hello, Thank you for your feedback. Sorry it took me a while to revise my code but here is my code with the changes: import urllib2 import json locu_api = 'redacted' def locu_search(query):     api_key = locu_api     url = 'https://api.locu.com/v1_0/venue/search/?api_key=' + api_key     locality

Re: [Tutor] Custom Function that Takes argument

2015-10-12 Thread Alan Gauld
On 13/10/15 00:32, Nym City wrote: ans=raw_input("What would you like to do? ") if ans=="1": locality = raw_input("\nEnter City ") break elif ans=="2": region = raw_input("\n Search by State ") break elif ans=="3": zip = raw_input("\n Search by Zip

Re: [Tutor] Custom Function that Takes argument

2015-10-12 Thread Nym City via Tutor
Thank you for your response. I updated the first portion of my code to include breaks: import urllib2 import json locu_api = 'redacted' ans=True while ans:     print ("""     1.Search by City     2.Search by Region (State Abbreviation)     3.Search by Zip     4.Exit/Quit     """)     ans=raw_i

Re: [Tutor] Custom Function that Takes argument

2015-10-11 Thread Alan Gauld
On 11/10/15 22:22, Nym City wrote: import urllib2 import json locu_api = 'redacted' ans=True while ans: print (""" 1.Search by City 2.Search by State 3.Search by Zip 4.Exit/Quit """) ans=raw_input("What would you like to do? ") if ans=="1": print("\n Enter

Re: [Tutor] Custom Function that Takes argument

2015-10-11 Thread Nym City via Tutor
Thank you for your feedback. I modified the code to reflect your suggestion and it worked. Now, I want to take it to the next level when I prompt the user to make a selection from a list of options and based on their input certain part of the code would execute. Here is the revised code:(site: h

Re: [Tutor] Custom Function that Takes argument

2015-09-28 Thread Alan Gauld
On 29/09/15 00:45, Nym City via Tutor wrote: I am learning how to create custom functions and watched the > tutorial online that uses API for locu Since most folks here probably don't know locu you should maybe give us a URL. Then we can know what it is you are talking about. I cannot figure