BEGIN.Python | R Documentation |
The function BEGIN.Python starts an Python read-eval-print loop.
BEGIN.Python()
BEGIN.Python emulates the behavior of the Python terminal and therefore allows interactive Python code development from within R.
Returns the entered code as character, code lines which throw an exception are omitted.
This won't work with RStudio because of a known RStudio issue.
## Not run:
code <-
BEGIN.Python()
import os
os.getcwd()
dir(os)
x = 3**3
for i in xrange(10):
if (i > 5):
print(i)
END.Python
## NOTE: BEGIN.Python returns the successfully executed code as character.
cat(code, sep="\n")
pyGet0("x")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.