Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def start_gui(**kwargs):
import sys
from PyQt5 import QtWidgets
from pandasgui.gui import PandasGUI
# Set up QApplication
app = QtWidgets.QApplication.instance()
if not app:
app = QtWidgets.QApplication(sys.argv)
# Make GUi
win = PandasGUI(block=True, **kwargs)
app.exec_()
df_name = "untitled" + str(i + 1)
for var_name, var_val in callers_local_vars:
if var_val is df_object:
df_name = var_name
dataframes[df_name] = df_object
# Add the dictionary of positional args to the kwargs
if any([key in kwargs.keys() for key in dataframes.keys()]):
logger.warning(
"Duplicate DataFrame names were provided, duplicates were ignored."
)
kwargs = {**kwargs, **dataframes}
pandas_gui = PandasGUI(**kwargs)
if store.settings.block:
pandas_gui.app.exec_()
return pandas_gui