| Copyright | (c) Laurent P René de Cotret 2018 |
|---|---|
| License | MIT |
| Maintainer | laurent.decotret@outlook.com |
| Stability | internal |
| Portability | portable |
| Safe Haskell | Unsafe |
| Language | Haskell2010 |
Text.Pandoc.Filter.Scripting
Description
This module defines types and functions that help with running Python scripts.
Synopsis
- runTempPythonScript :: PythonScript -> IO ScriptResult
- addPlotCapture :: FilePath -> PythonScript -> PythonScript
- hasBlockingShowCall :: PythonScript -> Bool
- type PythonScript = String
- data ScriptResult
Documentation
Arguments
| :: PythonScript | Content of the script |
| -> IO ScriptResult | Result with exit code. |
Take a python script in string form, write it in a temporary directory, then execute it.
Arguments
| :: FilePath | Path where to save the figure |
| -> PythonScript | Raw code block |
| -> PythonScript | Code block with added capture |
Modify a Python plotting script to save the figure to a filename.
hasBlockingShowCall :: PythonScript -> Bool Source #
Detect the presence of a blocking show call, for example "plt.show()"
type PythonScript = String Source #
String representation of a Python script
data ScriptResult Source #
Possible result of running a Python script
Constructors
| ScriptSuccess | |
| ScriptFailure Int |