Hi!
I have a code in python that compares csv’s using pandas etc, that I need to trigger every time a button is pressed in grasshopper (basically whenever it receives a True input).
I have done it before with a simple app.py pointAt on a circle and all that but now trying with a more complicated definition nothing seems to happen.
There’s code without the entire function in the middle:
import pandas as pd
# import numpy as np
import ghhops_server as hs
import rhino3dm
from flask import Flask
app = Flask(__name__)
hops = hs.Hops(app)
@hops.component(
"/compare_csv",
name="CompareCsv",
description="Comparing Plot & Typos",
inputs=[
hs.HopsBoolean("b", "Boolean", "Run Comparison"),
],
)
def compare_csv(b):
if b:
# pandas stuff here
# Save Results
dict_df.to_csv(result_csv, index=True)
return print("File written successfully")
Again, I type python .\app.py in the terminal and simply nothing happens…
Please help!
Thanks,
Lev