Python Forum
Python Variable manipulation
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python Variable manipulation
#5
Thanks for the help, Dicts was defiantly the way to look at it. And even though this is probably not the most refined answer, here is what I will be using:

   
    arrow_dict = {'desc_part_number': 'not_selected',
                    'asc_part_number': 'not_selected',
                    'desc_product_serial_number': 'not_selected',
                    'asc_product_serial_number': 'not_selected',
                    'desc_result': 'not_selected',
                    'asc_result': 'not_selected',
                    'desc_date_time': 'not_selected',
                    'asc_date_time': 'not_selected',
                    'desc_location_of_test': 'not_selected',
                    'asc_location_of_test': 'not_selected',
                    'desc_test_equipment_set': 'not_selected',
                    'asc_test_equipment_set': 'not_selected'
                   }

    selected_column = my_order_direction+'_'+order_column
    print('************************************'+selected_column+'*************************************')
    arrow_dict.update({selected_column: 'selected'})

    desc_part_number_final = arrow_dict['desc_part_number']
    asc_part_number_final = arrow_dict['asc_part_number']
    desc_product_serial_number_final = arrow_dict['desc_product_serial_number']
    asc_product_serial_number_final = arrow_dict['asc_product_serial_number']
    desc_result_final = arrow_dict['desc_result']
    asc_result_final = arrow_dict['asc_result']
    desc_date_time_final = arrow_dict['desc_date_time']
    asc_date_time_final = arrow_dict['asc_date_time']
    desc_location_of_test_final = arrow_dict['desc_location_of_test']
    asc_location_of_test_final = arrow_dict['asc_location_of_test']
    desc_test_equipment_set_final = arrow_dict['desc_test_equipment_set']
    asc_test_equipment_set_final = arrow_dict['asc_test_equipment_set']
Reply


Messages In This Thread
Python Variable manipulation - by KirkmanJ - Aug-14-2018, 09:30 AM
RE: Python Variable manipulation - by j.crater - Aug-14-2018, 09:49 AM
RE: Python Variable manipulation - by buran - Aug-14-2018, 09:58 AM
RE: Python Variable manipulation - by ichabod801 - Aug-14-2018, 12:32 PM
RE: Python Variable manipulation - by KirkmanJ - Aug-14-2018, 01:32 PM
RE: Python Variable manipulation - by buran - Aug-14-2018, 01:36 PM
RE: Python Variable manipulation - by ichabod801 - Aug-14-2018, 01:51 PM
RE: Python Variable manipulation - by KirkmanJ - Aug-14-2018, 02:58 PM
RE: Python Variable manipulation - by snippsat - Aug-14-2018, 11:13 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Variable Manipulation Tbot1000 7 4,265 Aug-31-2020, 06:40 PM
Last Post: deanhystad
  Python re.sub text manipulation on matched contents before substituting xilex 2 3,206 May-19-2020, 05:42 AM
Last Post: xilex
  [split] Python Pillow - Photo Manipulation keegan_010 1 3,919 Oct-11-2018, 09:57 AM
Last Post: Larz60+
  Python Pillow - Photo Manipulation keegan_010 2 3,634 Oct-11-2018, 03:49 AM
Last Post: keegan_010

Forum Jump:

User Panel Messages

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