diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-06-15 10:53:06 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-15 10:53:06 -0400 |
commit | c12ba0ff11b3a8fd083c641cb9149aff6494bbf9 (patch) | |
tree | a858864c091088e633de6ba6c8db55fd618a71e7 /examples/python_scripting.py | |
parent | b3759991adca62779ef7aefbff9dc7004463e129 (diff) | |
parent | 6a122ae91b6a3fabc3709b1d488843715258e58c (diff) | |
download | cmd2-git-c12ba0ff11b3a8fd083c641cb9149aff6494bbf9.tar.gz |
Merge pull request #701 from python-cmd2/rename
Rename load, _relative_load, and pyscript
Diffstat (limited to 'examples/python_scripting.py')
-rwxr-xr-x | examples/python_scripting.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/python_scripting.py b/examples/python_scripting.py index da7d0f6a..3e8f64ef 100755 --- a/examples/python_scripting.py +++ b/examples/python_scripting.py @@ -2,15 +2,15 @@ # coding=utf-8 """A sample application for how Python scripting can provide conditional control flow of a cmd2 application. -cmd2's built-in scripting capability which can be invoked via the "@" shortcut or "load" command and uses basic ASCII -text scripts is very easy to use. Moreover, the trivial syntax of the script files where there is one command per line -and the line is exactly what the user would type inside the application makes it so non-technical end users can quickly -learn to create scripts. +cmd2's built-in scripting capability, which can be invoked via the "@" shortcut or "run_script" command, uses basic +ASCII/UTF-8 text scripts and is very easy to use. Moreover, the trivial syntax of the script files, where there is one +command per line and the line is exactly what the user would type inside the application, makes it so non-technical +that end users can quickly learn to create scripts. However, there comes a time when technical end users want more capability and power. In particular it is common that users will want to create a script with conditional control flow - where the next command run will depend on the results -from the previous command. This is where the ability to run Python scripts inside a cmd2 application via the pyscript -command and the "pyscript <script> [arguments]" syntax comes into play. +from the previous command. This is where the ability to run Python scripts inside a cmd2 application via the +run_pyscript command and the "run_pyscript <script> [arguments]" syntax comes into play. This application and the "scripts/conditional.py" script serve as an example for one way in which this can be done. """ |