amilanes

vbScript to Python:  Help a newbie

Discussion created by amilanes on Jan 28, 2013
Latest reply on Jan 29, 2013 by curtvprice
I'm new to python and can't figure out how to convert this vbscript.  Can anyone help me out?

Thanks!

Dim INIOILCAT
Dim FINOILCAT

If [DIST] = "NO" Then
 INIOILCAT = "NO"

 elseif [DIST] = "CN" Then
 If [WIDTH] = "W" Then
  INIOILCAT = "H"
 
  elseif [WIDTH] = "M" Then
  INIOILCAT = "H"

  elseif [WIDTH] = "N" Then
  INIOILCAT = "M"

  else
  INIOILCAT = "L"

 end if

 elseif [DIST] = "BR" Then
 If [WIDTH] = "W" Then
  INIOILCAT = "H"
 
  elseif [WIDTH] = "M" Then
  INIOILCAT = "H"

  elseif [WIDTH] = "N" Then
  INIOILCAT = "M"

  else
  INIOILCAT = "L"

 end if

 elseif [DIST] = "PT" Then
 If [WIDTH] = "W" Then
  INIOILCAT = "M"
 
  elseif [WIDTH] = "M" Then
  INIOILCAT = "M"

  elseif [WIDTH] = "N" Then
  INIOILCAT = "L"

  else
  INIOILCAT = "VL"

 end if

 elseif [DIST] = "SP" Then
 If [WIDTH] = "W" Then
  INIOILCAT = "L"
 
  elseif [WIDTH] = "M" Then
  INIOILCAT = "L"

  elseif [WIDTH] = "N" Then
  INIOILCAT = "VL"

  else
  INIOILCAT = "VL"

 end if

 else
 INIOILCAT = "VL"

end if

IF INIOILCAT = "NO" Then
 FINOILCAT = "NO"

 elseif INIOILCAT = "H" Then
 If [THICK] = "PO/TO" Then
  FINOILCAT = "H"

  elseif [THICK] = "CV" Then
  FINOILCAT = "H"

  elseif [THICK] = "CT" Then
  FINOILCAT = "M"

  else
  FINOILCAT = "L"

 end if

 elseif INIOILCAT = "M" Then
 If [THICK] = "PO/TO" Then
  FINOILCAT = "H"

  elseif [THICK] = "CV" Then
  FINOILCAT = "H"

  elseif [THICK] = "CT" Then
  FINOILCAT = "M"

  else
  FINOILCAT = "L"

 end if

 elseif INIOILCAT = "L" Then
 If [THICK] = "PO/TO" Then
  FINOILCAT = "M"

  elseif [THICK] = "CV" Then
  FINOILCAT = "M"

  elseif [THICK] = "CT" Then
  FINOILCAT = "L"

  else
  FINOILCAT = "VL"

 end if

 elseif INIOILCAT = "VL" Then
 If [THICK] = "PO/TO" Then
  FINOILCAT = "L"

  elseif [THICK] = "CV" Then
  FINOILCAT = "L"

  elseif [THICK] = "CT" Then
  FINOILCAT = "VL"

  else
  FINOILCAT = "VL"

 end if

end if

Outcomes