Python
The ActorCore Python client provides a way to connect to and interact with actors from Python applications.
ActorCore is still pre-v1.0. Please help us by report bugs on GitHub Issues!
Quickstart
Create a new Python project
Create a new directory for your project:
It’s recommended to create a virtual environment:
Add dependencies
Install the ActorCore client package:
Define your actor
Create a file actors/app.ts
in your project with your actor definition:
Create your client
Create a new file main.py
:
In the code above, subscription is done with on_event
callbacks, but you can also
subscribe directly with receive()
calls, using the SimpleClient
(and AsyncSimpleClient
)
interfaces. See our sample usage for more details.
Start your ActorCore development server
Launch the development server with:
This will automatically start your app and open the studio in your browser. The studio supports hot-reloading, state inspection, visual RPC testing, and more debugging tools.
Run your client
In a separate terminal, run your Python code:
You should see output like:
Run it again to see the state update.
Deploy your ActorCore app
Now that you have your project running, deploy your application to one of these platforms: