Python to vb script conversion : I need to help in converting a Phyton script to VBS. I'm trying to load the .cal file as a binary value file and edit a particular value in the file but unfortunately, my environment only supports VBScript. 


    import argparse
    
    parser = argparse.ArgumentParser(description='Sapix Cal File Sensitivity Adjustment')
    parser.add_argument("-calfile", default="test.cal", help="Enter the Calfile name (ex: 09781DK5081.cal")
    parser.add_argument("-vtest", default=125, help="New Vtest setting (85-205)")
    parser.add_argument("-vref", default=250, help="New Vref setting (250-120)")
    
    
    args = parser.parse_args()
    calfile = args.calfile
    vtest = args.vtest
    vref = args.vref
    
    
    print(calfile)
    print(vtest)
    print(vref)
    
    	
    with open(calfile, "rb") as binary_file:
        # Read the whole file at once
    	data = bytearray(binary_file.read())
    	
    	# Find Line with VTEST setting
    	ivteststart = data.find(bytearray('PARALLEL_VOLTAGE_TEST', 'utf-8'))
    	ivtestend = data.find(b'\n',ivteststart)
    	
    	# Remove original VTEST line
    	del data[ivteststart:ivtestend+1]
    	
    	# Insert New Line with new VTEST
    	new_vtest = bytearray("PARALLEL_VOLTAGE_TEST %s\n" % (vtest),'utf-8')
    	data[ivteststart:ivteststart] = new_vtest
    		
    	# Find Line with VREF setting
    	ivrefstart = data.find(bytearray('PARALLEL_VOLTAGE_REF', 'utf-8'))
    	ivrefend = data.find(b'\n',ivrefstart)
    	
    	# Remove original VREF line
    	del data[ivrefstart:ivrefend+1]
    	
    	# Insert New Line with new VREF
    	new_vref = bytearray("PARALLEL_VOLTAGE_REF %s\n" % (vref),'utf-8')
    	data[ivrefstart:ivrefstart] = new_vref
    	
    	
    	
    	# Write new sensitivity settings to cal file
    with open(calfile, "wb") as binary_file:
    	binary_file.write(data)
    	
    	