Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Aug 20, 2022
1 parent 2b7b084 commit b07174e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion docs/tutorial/python/python-charts.eez-project
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
"description": "Start Python script from file charts.py located at the same folder as current dashboard project",
"scriptSourceOption": "script-file",
"scriptSourceInline": "",
"scriptSourceFile": "System.ProjectFolder + \"/charts.py\""
"scriptSourceFile": "System.ProjectFolder + \"/charts.py\"",
"pythonPath": "\"\""
},
{
"objID": "169bafb0-3689-49b0-c2d5-018286c4ff28",
Expand Down
8 changes: 7 additions & 1 deletion packages/project-editor/flow/components/actions/python.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,16 @@ registerActionComponents("Python", [
enabled: (...props: string[]) => {
return props[0] != "script-file";
}
},
{
name: "pythonPath",
type: "expression",
valueType: "string"
}
],
defaults: {
scriptSourceOption: "inline-script"
scriptSourceOption: "inline-script",
pythonPath: '""'
},
bodyPropertyCallback: (...props: string[]) => {
if (props[0] == "inline-script") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,9 @@ registerExecuteFunction(
scriptFilePath = scriptSource;
}

const options: Options = {};
const options: Options = {
pythonPath: context.evalProperty<string>("pythonPath")
};
const pythonShell = new PythonShell(scriptFilePath, options);
addPythonShell(context.WasmFlowRuntime, pythonShell);

Expand Down

0 comments on commit b07174e

Please sign in to comment.