-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
34 lines (24 loc) · 907 Bytes
/
example.py
File metadata and controls
34 lines (24 loc) · 907 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""GenFlux SDK の動作確認サンプル."""
import genflux
from genflux import GenFlux
def main() -> None:
"""メイン関数."""
# モジュール関数を試す
print("=== genflux モジュール ===")
print(genflux.hello()) # type: ignore[attr-defined]
print(genflux.hello("GenFlux")) # type: ignore[attr-defined]
print(f"Version: {genflux.version()}") # type: ignore[attr-defined]
# クライアントを試す
print("\n=== GenFlux Client ===")
client = GenFlux()
# ping
result = client.ping() # type: ignore[attr-defined]
print(f"ping: {result}")
# echo
message = client.echo("PyPI からインストール成功!") # type: ignore[attr-defined]
print(f"echo: {message}")
# add
answer = client.add(100, 200) # type: ignore[attr-defined]
print(f"add(100, 200) = {answer}")
if __name__ == "__main__":
main()