is_python | R Documentation |
This function takes a character string as input and checks if it contains valid Python code. It returns TRUE if the string contains valid Python code, and FALSE otherwise.
is_python(code)
code |
A character string containing code to be checked for Python code validity. |
This function presuposes that python is installed on the system.
A logical value: TRUE if the input character string contains valid Python code, and FALSE otherwise.
## Not run:
# Check if the string contains valid Python code
is_python("print('Hello, World!')")
# Check if the string contains invalid Python code
is_python("prit('Hello, World!')")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.