2

I am a beginner in NodeJS. I have worked on some scripts in python which does some calculation on two csvs. Is there a easy way to migrate a python script to NodeJS? I don't know whether its a right way to do it. But I wanted to know is there any way for for it.

Any suggestions will be encouragable.

csvb
  • 365
  • 2
  • 6
  • 14
  • 2
    Please show the python code so we can better assist you. – OneCricketeer Jul 25 '16 at 15:18
  • Hello, now are you talking about actually transferring the code from Python to Javascript? OR are you talking about just running the Python scripts in your Node server, and then returning the data? – Michael Jones Jul 25 '16 at 15:21
  • Thank you @MichaelJones for the reply. I was trying to know is there a way where we can convert the code. But like everyone said here, I think its a best way to start doing it actually. Thanks for the help. I will start learning NodeJS and then ask questions if I have any. – csvb Jul 26 '16 at 03:41

2 Answers2

1

If you simply want to convert the code to javascript there are tools available like transcrypt which converts the python code to javascript.

v.coder
  • 1,822
  • 2
  • 15
  • 24
  • Thank you @v.coder. I will try this if I find any difficulty in learning to code in NodeJS. – csvb Jul 26 '16 at 03:43
0

Simple way : understand your code and rewrite it in node.js format.

If you're a beginner in node.js, it's a good exercise to understand how node.js works.

I recommand you this post which regroup a lot of ressources to begin node.js : How do I get started with Node.js

EDIT : you can also execute your Python script with a node.js process, and use the result in node.js.

Documentation : https://nodejs.org/api/process.html

Community
  • 1
  • 1
F. Kauder
  • 879
  • 5
  • 9
  • 1
    Thank you @F.kauder for leading me with so many documentation. I will start reading them and try to code. – csvb Jul 26 '16 at 03:42