Python Forum
Define a range, return all numbers of range that are NOT in csv data
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Define a range, return all numbers of range that are NOT in csv data
#19
So no I am on to my next part of this.

Please let me know if you would prefer me to create a new thread. But it is a continuation of this project for me.

I am trying to create a dynamic menu system that will produce menu items based on what items are specified in the _number_ranges dictionary. .

# Define Site Ranges Dictionary
_number_ranges = {
    "549StKilda": {
        'start': 61392697000,
        'end': 61392697999,
        'name': "549 StKilda Rd"
    },
    "Mulgrave": {
        'start': 61385849100,
        'end': 61385849199,
        'name': "Mulgrave"
    },
    "Rhodes": {
        'start': 61298169000,
        'end': 61298169999,
        'name': "Rhodes"
    },
    "Not Defined Number": {
        'start': 0,
        'end': 99999999999,
        'name': "NON Number"
    },

def find_available_n():
    for num_range in _number_ranges:
        print(num_range)
        #Ask for Choice
        choose_range = input("Select Range: ")
        return choose_range
I am trying to create a menu system that will provide number options base of the number of ranges I have defined. Currently my code will only produce the first range.

Since I have defined, StKilda Rd, Mulgrave and Rhodes. I would like the find_available_n function to Print the options

print ("""Select Range:
1. for StKilda Rd
2. for Mulgrave
3. for Rhodes
4. for NON Number""")
Then If I add a another range to the define dictionary of ranges _number_ranges i would like that to be added as well.
Reply


Messages In This Thread
RE: Define a range, return all numbers of range that are NOT in csv data - by KiNeMs - Jan-24-2020, 06:19 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How do I calculate a ratio from 2 numbers and return an equivalent list of about 1000 Pleiades 8 15,781 Jan-05-2024, 08:30 PM
Last Post: sgrey
  [SOLVED] [loop] Exclude ranges in… range? Winfried 2 1,518 May-14-2023, 04:29 PM
Last Post: Winfried
Thumbs Down I hate "List index out of range" Melen 20 3,396 May-14-2023, 06:43 AM
Last Post: deanhystad
  How to check multiple columns value within range SamLiu 2 1,193 Mar-13-2023, 09:32 AM
Last Post: SamLiu
  Expand the range of a NumPy array? PythonNPC 0 775 Jan-31-2023, 02:41 AM
Last Post: PythonNPC
  Copying files if the name is in range tester_V 9 1,618 Nov-24-2022, 12:21 AM
Last Post: tester_V
Exclamation IndexError: Replacement index 2 out of range for positional args tuple - help? MrKnd94 2 6,507 Oct-14-2022, 09:57 PM
Last Post: MrKnd94
  Solving an equation by brute force within a range alexfrol86 3 2,851 Aug-09-2022, 09:44 AM
Last Post: Gribouillis
  IndexError: list index out of range dolac 4 1,956 Jul-25-2022, 03:42 PM
Last Post: deanhystad
  I'm getting a String index out of range error debian77 7 2,386 Jun-26-2022, 09:50 AM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020