from anvil.js.window import navigator
print(navigator.userAgentData.platform)
For me this prints “Windows” which is correct.
According to that MDN / WebAPI link above, the available values for platform
are:
One of the following strings: "Android"
, "Chrome OS"
, "Chromium OS"
, "iOS"
, "Linux"
, "macOS"
, "Windows"
, or "Unknown"
.