Logo
Explore Help
Sign In
OilfieldToolsNet/opm-common
4
0
Fork 0
You've already forked opm-common
Code Issues Pull Requests Packages Projects Releases Wiki Activity
Files
54087e3bd8cfcec6d71e131012fea679b15f92db
opm-common/tests/act1.py

16 lines
214 B
Python
Raw Normal View History

PYACTION: The actual python code is in an external file With this commit the PYACTION keyword is changed, instead of embedding the Python code directly in the .DATA file the keyword now points to an external file which is loaded verbatim into the PyAction keyword. In addition the PYACTION keyword has now got a name and a string indicating how many times it should run.
2020-03-16 11:34:12 +01:00
from math import sin
import random
Run PYACTION keywords The PYACTION keyword is implemented with a Python module with a run() function in an external module.
2020-03-22 21:02:32 +01:00
def run():
pass
PYACTION: The actual python code is in an external file With this commit the PYACTION keyword is changed, instead of embedding the Python code directly in the .DATA file the keyword now points to an external file which is loaded verbatim into the PyAction keyword. In addition the PYACTION keyword has now got a name and a string indicating how many times it should run.
2020-03-16 11:34:12 +01:00
print("sin(0) = {}".format(sin(0)))
#---
if random.random() > 0.25:
print("Large outcome")
else:
print("Small result")
A = 100
B = A / 10
C = B * 20
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 28ms Template: 1ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API