<
From version < 10.1 >
edited by aas2
on 2017/10/25 13:43
To version < 9.1 >
edited by aas2
on 2017/10/24 15:52
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -171,7 +171,7 @@
171 171  String, the shell command that is used to start the process
172 172  )))|(% colspan="1" %)(% colspan="1" %)
173 173  (((
174 -python -i "${executable_path}"
174 +python "${executable_path}"
175 175  )))|(% colspan="1" %)(% colspan="1" %)
176 176  (((
177 177  The shell command to start the executable
... ... @@ -701,30 +701,4 @@
701 701  
702 702  === Python Example ===
703 703  
704 -The following shows a tiny python script, that will write a Data Pool containing an output variable x to stdout.
705 -
706 -{{code title="prog.py"}}
707 -import sys
708 -
709 -x = 0
710 -while True:
711 - json = """{"x":{"value":""" + str(x) + ""","interface":2}}"""
712 - print(json) # Send output to simulation
713 - raw_input("") # Wait for input from simulation
714 - x = x + 1
715 -
716 -
717 -{{/code}}
718 -
719 -This script can be executed from within KIELER to start a simulation because it uses the JSON communication on stdin and stdout. Note however that the input coming from the simulation is not handled in the script. An example kisim configuration to start such a scipt is given below.
720 -
721 -{{code}}
722 -configure sim A {
723 - executable: prog.py
724 - command: "python -i ${executable_path}"
725 -}
726 -
727 -execution {
728 - write sim A
729 -}
730 -{{/code}}
704 +\\
Confluence.Code.ConfluencePageClass[0]
Id
... ... @@ -1,1 +1,1 @@
1 -33260106
1 +33260105
URL
... ... @@ -1,1 +1,1 @@
1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/33260106/V2 Simulation
1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/33260105/V2 Simulation