Skip to main content

How to ignore warnings in Python

I have a Python script built that imports files in a directory that I rewrote from Ideascript. In Idea I have IgnoreWarning(True) that prevents being warned on each import. I can't get this command to even run in Python. Any Ideas?

Thanks,

Randy

Brian Element Wed, 11/18/2026 - 06:24

There is no equivalent to the IgnoreWarning(True) in Python and this command is a Visual Basic command so you can't use it in Python.  What you would need to do is write a routine that does the same thing.  If you want to overwrite the files then you would have to write some python code to check if the file exists and if it does to delete it through they Python code.

randywb Wed, 11/18/2026 - 13:10

In my case it was an append, so the logic is a little different.

I found a workaround. I will post it here in case it helps others
Put the IgnoreWarning in the ISS file and then call the Python file, and it works.
Dim ProjectLocation As String

Sub Main
IgnoreWarning(True)
ProjectLocation = Client.WorkingDirectory()
Client.RunPython ProjectLocation & "Macros.ILB\PrintReprtDev.py"
Client.RefreshFileExplorer
Client.CloseAll
Set task = Nothing
Set db = Nothing
Set field = Nothing
End Sub