python_shell 0.0.7 copy "python_shell: ^0.0.7" to clipboard
python_shell: ^0.0.7 copied to clipboard

Python Environment Manager and Executor for dart and flutter

example/python_shell_example.dart

import "package:python_shell/python_shell.dart";

void main() async {
    // 현재 스타일
//     var shell = PythonShell(shellConfig: PythonShellConfig(
//         pythonRequires: [ "PySide6" ],
//         defaultWorkingDirectory: "example"
//     ));
//     await shell.initialize();

//     await shell.runString("""
// import os, PySide6

// print("in python: ", os.getcwd())
// print("in python: ", PySide6)
// """, useInstance: true, instanceName: "testInstance1", listener: ShellListener(
//         completeCallback: () {
//             print(shell.resolved);
//             // shell.clear();
//         }
//     ));

    var shell = PythonShell(PythonShellConfig());
    await shell.initialize();

    var instance = ShellManager.getInstance("default");
    instance.installRequires([ "PySide6" ]);
    await instance.runString("""
import os, PySide6

print("in python: ", os.getcwd())
print("in python: ", PySide6)
""", echo: true);

    print("finished");
}
12
likes
130
pub points
55%
popularity

Publisher

unverified uploader

Python Environment Manager and Executor for dart and flutter

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

archive, dio, intl, path

More

Packages that depend on python_shell