PYNotebook

extends Nodebook

"PYNotebook" is used for .pyfiles.

Usage

Setup

const Nodebook = require('nodejs-notebook');

let main = new Nodebook.PYNotebook('main');

note(code)

Similar to addLine() but it does not automatically add an indent.

string code: The Python code to add.

main.note('print("hello world"');
// Inserts this long line of code that should output "hello world"

comment(comment)

Insert a Python Comment.

string comment: The comment message to add.

main.comment('This needs editing, Franchis!');
// Inserts '""" Look over here, Patricia! """'

run()

Attempts to run the python file.

main.run();
// Will output if there were any errors in the console.

import(module)

Inserts import () at the top with the module provided.

main.import("json");
// Inserts "import json"

Last updated