Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Loop with choose
#1
Hello,
I have this script:
acw = [0.500, 0.750, 1.000, 1.500, 2.000, 3.000, 3.500, 4.000, 4.500, 5.000]
for rang in acw:
    dmm.set_mode_acw(rang)
    dmm.switch_output(1)
    time.sleep(10)
    val_list_dmm = []
    val_list_nom =[]
    for num_read in range(5): # cycle 1
        val_cal = fl.read_volt_result()
        time.sleep(2)
        val_src = dmm.read_data_volt()
        val_list_nom.append(val_src*1000)
        val_list_dmm.append(val_cal)
    dmm.switch_output(0)
    mean_meas = unc_gpi.mean_calc(val_list_dmm)
    mean_source = unc_gpi.mean_calc(val_list_nom)
    error = unc_gpi.acw_uncert(rang*1000)
    abs_error = unc_gpi.abs_error(mean_source, mean_meas)
    min_error = unc_gpi.min_error(mean_source, error)
    max_error = unc_gpi.max_error(mean_source, error)
    check_status = unc_gpi.check_error(error, mean_source, mean_meas)
I need add the following to it:

if check_status == "Fail",
need to prompt the user to enter three options:
1 Re-Measure
2 Continue
3 interrupt
If you select 1, this cycle will start: from # cycle 1, from the element of the list on which the "Fail", until it "Fail" or the user chooses 2 or 3
if select 2: continue code execution
if select 3: abort and complete the code
Reply


Messages In This Thread
Loop with choose - by Irv1n - Aug-12-2021, 03:50 PM
RE: Loop with choose - by deanhystad - Aug-12-2021, 08:59 PM
RE: Loop with choose - by Irv1n - Aug-20-2021, 10:44 AM
RE: Loop with choose - by deanhystad - Aug-20-2021, 03:37 PM
RE: Loop with choose - by Irv1n - Sep-16-2021, 07:38 PM
RE: Loop with choose - by deanhystad - Sep-16-2021, 09:31 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Mac os choose file name howard687 1 1,914 Jan-05-2022, 06:54 AM
Last Post: Larz60+
  Choose an element from multidimensional array quest_ 2 2,692 Nov-25-2020, 12:59 AM
Last Post: quest_
  Need help implmenting if/else or case statements for option to choose file format. samlee916 1 2,048 Jul-22-2020, 06:06 PM
Last Post: Larz60+
  Choose your own adventure game noahc2004 2 2,629 Jun-26-2020, 02:06 PM
Last Post: DPaul
  Please help a newbie choose which programming language to learn. yeto 2 3,565 Feb-25-2019, 12:56 AM
Last Post: yeto
  User Input to Choose from Dictionary anelliaf 9 25,975 Mar-27-2018, 02:22 PM
Last Post: anelliaf
  Reasons to choose Python over C++? RandoomDude 62 46,150 May-03-2017, 05:29 PM
Last Post: micseydel
  Need a little more help in a Choose Your Own Adventure Program Goldberg291 13 18,716 Jan-31-2017, 08:33 AM
Last Post: Ofnuts

Forum Jump:

User Panel Messages

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