Hi all I am trying to use if else statement in python but it is not working
If I set bool as true or false for both the cases it is giving me else result. I want if bool is false then if statement should execute if it is true then else statement should be executed.
import sys
import clr
import System
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference('System.Windows.Forms')
from System.Windows.Forms import MessageBox, MessageBoxButtons, MessageBoxIcon, DialogResult, OpenFileDialog
if IN[0]=="false":
openFileDialog = OpenFileDialog()
openFileDialog.Filter = "Excel files (*.xlsx)|*.xlsx|All files (*.*)|*.*"
openFileDialog.FilterIndex = 2
openFileDialog.RestoreDirectory = True
if openFileDialog.ShowDialog() == DialogResult.OK:
filePath = openFileDialog.FileName
System.Diagnostics.Process.Start(filePath)
# wait
MessageBox.Show( "Modify Excel file, Save it and click OK", "Waiting...", MessageBoxButtons.OK, MessageBoxIcon.Information)
OUT = filePath
else:
OUT = "Leave"
Please let me know what should I do if I want to execute the if statement when I set bool as false