The public_api.py
module#
Summary#
Launch PyWorkbench server on the local or a remote Windows machine. |
|
Create a PyWorkbench client that connects to an already running Workbench server. |
Description#
Module for starting PyWorkbench.
Module detail#
- public_api.launch_workbench(show_gui=True, version=None, client_workdir=None, server_workdir=None, host=None, username=None, password=None)#
Launch PyWorkbench server on the local or a remote Windows machine.
This method launch a Workbench server on the local or a remote Windows machine and creates a PyWorkbench client that connects to the server.
- Parameters:
- show_guibool, default:
True
Weather to launch Workbench in UI mode.
- version
str
, default:None
Workbench version to launch. It must be a 3-digit version that is “242” or later.
- client_workdir
str
, default:None
Path to a writable directory on the client computer. The default is
None
, in which case the system temp directory is used.- server_workdir
str
,None
Path to a writable directory on the server computer. The default is
None
, in which case the user preference for the Workbench temporary file folder is used.- host
str
,None
Server computer’s name or IP address. The default is
None
for launching on the local computer.- username
str
,None
User’s login name on the server computer. The default is
None
for launching on the local computer.- password
str
,None
User’s password on the server computer. The default is
None
for launching on the local computer.
- show_guibool, default:
- Returns:
WorkbenchClient
Instance of the PyWorkbench client that is connected to the launched server.
Examples
Launch a server on the local computer and use the
wb
variable to hold the returned client.>>> from ansys.workbench.core import launch_workbench >>> wb = launch_workbench()
- public_api.connect_workbench(port, client_workdir=None, host=None)#
Create a PyWorkbench client that connects to an already running Workbench server.
- Parameters:
- Returns:
WorkbenchClient
Instance of the PyWorkbench client that is connected to the server.
Examples
Connect to a server at port 32588 on localhost and use the
wb
variable to hold the returned client.>>> from ansys.workbench.core import connect_workbench >>> wb = connect_workbench(port = 32588)