Get return from .mjs script to Python

94
July 25, 2022, at 12:00 PM

I need to execute .mjs script about 200 times with another parameters (changableParametr):

import { Connection, PublicKey } from "@solana/web3.js";
import { Metadata } from "@metaplex-foundation/mpl-token-metadata";
const connection = new Connection("https://api.mainnet-beta.solana.com");
(async () => {
   let mintPubkey = new PublicKey(changableParametr);
   let tokenmetaPubkey = await Metadata.getPDA(mintPubkey);
   const tokenmeta = await Metadata.load(connection, tokenmetaPubkey);
   console.log(tokenmeta);
   })();

How get result to Python? I thought to use multiprocessing. Maybe expand this .mjs script to make .json file, because i need only one string from result. What is the easiest method to do this?

Rent Charter Buses Company
READ ALSO
render page after for loop is finished node.js

render page after for loop is finished node.js

I'm having an async problem, and I've followed a lot of articles online to try and get this issue fixed, but it hasn't done anything

49
overwrite or reinstall nodejs and npm on windows

overwrite or reinstall nodejs and npm on windows

Long story short, I'd like to reinstall nodejs on my windows systemHowever after I downloaded the msi file and ran it, it failed complaining about cannot find D drive

79
Call a function according to its string name [duplicate]

Call a function according to its string name [duplicate]

I have a code which would be very repetitive, which according to the name of the string of an array executes one function or another

98
Cors not allowed while using Axios

Cors not allowed while using Axios

Hey I was working with fetch a normal fetch to request my API in my server, and It was working, but I found out that Axios is easier, so I tried to replace every fetch, but it looks like xhr doesn't work because of cors,

72