Dear AWESOME users,
First, I have to say this module is not a complete Python language inside JavaScript(DUH), instead this module is some core build in function I think is useful Python have :P
@felixfong227
# Python
print ("Howdy y'all")
// JavaScript
const pynodejs = require('pynodejs')
pynodejs.print("Howdy y'all")
# Python
splitString = list('This is a string')
// JavaScript
const pynodejs = require('pynodejs')
const splitString = pynodejs.list('This is a string')
# Python
fo = open('textfile.txt', 'r')
fileContent = fo.read()
// JavaScript
const pynodejs = require('pynodejs')
const fileContent = pynodejs.read('textfile.txt')
# Python
fo = open('textfile.txt', 'w')
fo.write('pony!')
// JavaScript
const pynodejs = require('pynodejs')
pynodejs.write('textfile.txt', 'pony!')
# Python
isStringRight = isinstance('String', 'char');
// JavaScript
const pynodejs = require('pynodejs')
pynodejs.isinstance('String', 'char')
# Python
stringLength = len('This is a string')
// JavaScript
const pynodejs = require('pynodejs')
const stringLength = pynodejs.len('This is a string')
# Python
rounded = round(3.14)
// JavaScript
const pynodejs = require('pynodejs')
const rounded = pynodejs.round(3.14)
# Python
m = md5.new()
m.update("Howdy")
m.hax()
// JavaScript
const pynodejs = require('pynodejs')
const encrypttion = pynodejs.encrypt.md5('Howdy')
# Python
m = md5.new()
m.update("Howdy")
m.hax()
// JavaScript
const pynodejs = require('pynodejs')
const encrypttion = pynodejs.encrypt.sha224('Howdy')