kalebswartz7/excercise_01/parse.py
def populate_dictionary(line, d_to_populate, starting_point, ending_point, d, d1=None, type1='float'):
    """
    Populate dictionary based on wanting a certain portion of a string 

    Parameters
    ----------
    line : string
        string that contains 'substring'
    d_to_populate : dictionary
        first level dictionary to store 'substring'
    starting_point : string
        string character that comes right before 'substring'
    ending_point : string
        string character that comes right after 'substring'
    d : dictionary
        second level dictionary to store 'substring' 
    d1 : dictionary
        third level dictionary to store 'substring', optional
    type1 : string
        what type 'substring' is when stored in dictionary
    
    Notes
    -----

    """
    start = line.find(starting_point) + 1
    end = line.find(ending_point)

    if type1 is 'string':
        substring_value = (line[start:end])
    elif type1 is 'int':
        substring_value = int(line[start:end])
    else:
        substring_value = float(line[start:end])

    #Checks to see if d1 is actually necessary 
    if not d1:
        d_to_populate[d] = substring_value
    else:
        d_to_populate[d][d1] = substring_value

    Populate dictionary based on wanting a certain portion of a string 

    Parameters
    ----------
    line : string
        string that contains 'substring'
    d_to_populate : dictionary
        first level dictionary to store 'substring'
    starting_point : string
        string character that comes right before 'substring'
    ending_point : string
        string character that comes right after 'substring'
    d : dictionary
        second level dictionary to store 'substring' 
    d1 : dictionary
        third level dictionary to store 'substring', optional
    type1 : string
        what type 'substring' is when stored in dictionary
    
    Notes
    -----

    
Populate dictionary based on wanting a certain portion of a string
Parameters



Notes
Populate dictionary based on wanting a certain portion of a string Parameters Notes
def populate_dictionary(line, d_to_populate, starting_point, ending_point, d, d1=None, type1='float'):
    start = line.find(starting_point) + 1
    end = line.find(ending_point)
    if type1 is 'string':
        substring_value = (line[start:end])
    elif type1 is 'int':
        substring_value = int(line[start:end])
    else:
        substring_value = float(line[start:end])
    if not d1:
        d_to_populate[d] = substring_value
    else:
        d_to_populate[d][d1] = substring_value
def populate_dictionary ( line , d_to_populate , starting_point , ending_point , d , d1 = None , type1 = 'float' ) : start = line . find ( starting_point ) + 1 end = line . find ( ending_point ) if type1 is 'string' : substring_value = ( line [ start : end ] ) elif type1 is 'int' : substring_value = int ( line [ start : end ] ) else : substring_value = float ( line [ start : end ] ) if not d1 : d_to_populate [ d ] = substring_value else : d_to_populate [ d ] [ d1 ] = substring_value
Populate dictionary based on wanting a certain portion of a string
Parameters
Populate dictionary based on wanting a certain portion of a string Parameters
"""
    Populate dictionary based on wanting a certain portion of a string 

    Parameters
    ----------
    line : string
        string that contains 'substring'
    d_to_populate : dictionary
        first level dictionary to store 'substring'
    starting_point : string
        string character that comes right before 'substring'
    ending_point : string
        string character that comes right after 'substring'
    d : dictionary
        second level dictionary to store 'substring' 
    d1 : dictionary
        third level dictionary to store 'substring', optional
    type1 : string
        what type 'substring' is when stored in dictionary
    
    Notes
    -----

    """ #Checks to see if d1 is actually necessary 
line
d_to_populate
starting_point
ending_point
d
d1
type1