Available for:
Supported Platforms:
flutter(dart) pub add python_shell
add dependency to 'pubspec.yaml'
dependencies:
[other dependencies...]
python_shell:
git:
url: git://github.com/eseunghwan/python_shell.dart.git
ref: master
import "package:python_shell/python_shell.dart";
var shell = PythonShell(); await shell.initialize();
await shell.runString("{pythonCode}");
- use instance
```dart
import "package:python_shell/python_shell.dart";
PythonShell().initialize();
var instance = ShellManager.getInstance("default");
await instance.runString("{pythonCode}");
// setups like above ...
shell.runString(
"{pythonCode}",
listener: ShellListener(
onMessage: (message) {
// if `echo` is `true`, log to console automatically
print("message!");
},
onError: (e, s) {
print("error!");
},
onComplete: () {
print("complete!");
}
)
);
for further informations, refers to shell.dart