Python Modules — NPM @ NODE. Python-Node, Py-Node, Node-Py.

Eric Michael McCormack
2 min readMay 25, 2024
import time
import npm
import artificial.substrate.client
import compileall
import pprint as pp

import npm.bindings
import npm.interrogate

class PythonNode:
def __init__(self):
pass

def nodepython(self):
while True:
pynodejs = input("Start PyNode.js, Yes or No: ")
if pynodejs.lower() in ['yes', 'y']:
npm.bindings.npm_install(target_dir="/home/yoshimoto-motokeo/node_modules")
print("PyNode.js started.")
break
elif pynodejs.lower() in ['no', 'n']:
print("PyNode.js not started.")
break
else:
print("Invalid input, please enter Yes or No.")

def pybug(self):
while True:
pydebug = input("Call Your Best debugger, debug force: Yes or No: ")
if pydebug.lower() in ['yes', 'y']:
print("Debugger called.")
break
elif pydebug.lower() in ['no', 'n']:
print("Debugger not called.")
break
else:
print("Invalid input, please enter Yes or No.")

def flagforce(self):
while True:
flagforce = input("Flag Force do you wish to put down a flag in logistics? Yes or No: ")
if flagforce.lower() in ['yes', 'y']:
flagger = input("Your Flag goes here: ")
print(f"Flag set: {flagger}")
break
elif flagforce.lower() in ['no', 'n']:
print("No flag set.")
break
else:
print("Invalid input, please enter Yes or No.")

def engine_node(self):
pathnode = '/home/yoshimoto-motokeo/node_modules/'
while True:
nodeinput = input("Please Provide a Node from the path: ")
npm.bindings.npm_install("/home/yoshimoto-motokeo/node_modules/fast-deep-equal")
npm.interrogate.run_command(cmd_to_run="/home/yoshimoto-motokeo/node_modules/atmosphere")
full_path = pathnode + nodeinput
print(f"Node path: {full_path}")
return npm.bindings.npm_run(full_path)
break
else:
print("Invalid input, please enter a valid node.")

url = "https://pynode.com"
print(f"Opening URL: {url}")
url = opennode(url)

ip = input("Enter your IP address: ")
if ip:
print(f"IP Address: {ip}")
else:
print("No IP address provided.")

compile = url, ip

def opennode(self):
nodeopen = 1
port = 5050
node_modules = input("What modules would you need for node_modules? ")
npm.bindings.npm_install(target_dir="/home/yoshimoto-motokeo/node_modules/ipaddr.js")
print(f"Node modules needed: {node_modules}")

def start(self):
self.nodepython()
self.pybug()
self.flagforce()
self.engine_node()
self.opennode()

if __name__ == '__main__':
while...:
node = PythonNode()
node.start()

Still A little buggy just an example of how to pynode or python node npm installs. like a said need to flag the bugs and fix them.

--

--