from Pyloid import PyloidAPI, Bridge
class CustomAPI(PyloidAPI):
@Bridge(str, int, result=str)
def echo(self, message, number):
print(f"메시지: {message}-{number}")
return f"Python에서 받은 메시지: {message}-{number}"
@Bridge(result=str)
def getAppVersion(self):
return "1.0.0"
@Bridge(result=str)
def create_window(self):
window = app.create_window(
title="Pyloid 브라우저2",
)
window.set_size(800, 600)
window.set_position(0, 0)
window.load_url("https://www.google.com")
window.show()
window.focus()
return window.id
window = app.create_window(
title="Pyloid 브라우저1",
js_apis=[CustomAPI()],
dev_tools=True
)
if (is_production()):
window.load_file(os.path.join(get_production_path() + "/index.html"))
else:
window.load_file("index.html")
window.show()
window.focus()
app.run()