import components.code as code import components.docs as docs pyp | queries
PyWPR docs

pyp | queries

in pywrp we use pyp.GET object for ?get=queries
you can access query parameters like dictionary keys
for example:

code.code_comp("""pyp.GET['name'] # or pyp.GET.get('name', 'default_value')""")

try it out:

<form method="get">
$
</form> if 'name' in pyp.GET and pyp.GET['name'].strip() != "": name = pyp.GET['name'] money = pyp.GET.get('money', "") if money != "" and not money.isdigit(): money = "" moneyText = f"you have a {'big' if int(money) >= 100 else "little"} money:  {money}$!" if money != "" else "you didn't tell me about your money" e(f"<!py>
hello, {name}!  {moneyText}
</py!>")

source

code.code_comp(f"""
{'<'}py!> if 'name' in pyp.GET and pyp.GET['name'].strip() != "": name = pyp.GET['name'] money = pyp.GET.get('money', '') if money != "" and not money.isdigit(): money = "" moneyText = f"you have a {'{'}'big' if int(money) >= 100 else "little"{'}'} money: {'{'}money{'}'}$!" \\ if money != "" else "you didn't tell me about your money" e(f"
hello, {'{'}name{'}'}! {'{'}moneyText{'}'}
") """,'html')