GodotPythonJSONRPC/TestPythonInExport.gd

50 lines
1.1 KiB
GDScript3
Raw Normal View History

2024-07-14 08:54:08 -07:00
extends Node
2024-07-14 18:40:49 -07:00
var pw : KiriPythonWrapperInstance
2024-07-14 08:54:08 -07:00
2024-07-14 18:40:49 -07:00
func _ready():
#pw = KiriPythonWrapperInstance.new(
#"/storage/git2/GodotJSONRPCTest/addons/KiriPythonRPCWrapper/KiriPythonRPCWrapper/test_module/__init__.py")
#pw.setup_python()
#pw.start_process()
#var ret = pw.call_rpc_sync("func_to_call", ["test string whatever blah"])
#print(ret)
2024-07-14 18:40:49 -07:00
#print("Calling the thing")
#butt("nkc sckccsd scaskcmasklcms")
#print("Done calling the thing:" )
#asdfblah.emit()
#pw.stop_process()
#
pw = KiriPythonWrapperInstance.new(
"res://SomePythonThingy/test_a_thing.py")
pw.setup_python()
pw.start_process()
print("Call thingy...")
var ret = await pw.call_rpc_async("some_function_to_call", [])
print("Done thingy...")
print(ret)
func _process(delta):
#if pw.get_status() == \
#KiriPythonWrapperInstance.KiriPythonWrapperStatus.STATUS_RUNNING:
#print("poll")
pw.poll()
#if pw.get_status() == \
#KiriPythonWrapperInstance.KiriPythonWrapperStatus.STATUS_STOPPED:
#print("IT STOPPED")
signal asdfblah
func butt(asdf):
print("Butt1: ", asdf)
await asdfblah
print("Butt2: ", asdf)
2024-07-14 12:58:20 -07:00
2024-07-14 18:40:49 -07:00