Communicating between a python and electron app [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I have a python app which needs a serious GUI lift so I've decided to use electron.
I have compiled my python app into an executable (.exe) which takes in arguments. On electron, the user will input and the executable will be sent that input as an argument to process it.
How would I tell electron what is happening behind the scenes in the executable.
My original thought was to make the executable write to a file and make electron read that file but that would probably end up corrupting the file instead when trying to read and write from the file.

You can run a python script/program inside your electron app. This way, you can control the status of the operation in electron and update the UI accordingly. here is an example of what I'm talking about.
If that's not a possibility, you could consider using a communication channel (webosckets for example) to interface between the two applications, sending status from one to another. Something like a RPC.

Related

How to integrate a python interface on website [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 months ago.
Improve this question
I made a Python interface and I'm trying to integrate it to a HTML/CSS website in a <div>, but I have no idea about how to do it.
Any idea? Do you know any solution ?
Thanks in advance
If you built a command-line interface (CLI) to your app, then you can expose it to the Internet via web framework like Flask in form of REST API. Then you can access it with JavaScript on the frontend side.
But If you've built a graphical user interface (GUI) using framework like Tkinter, it is nearly impossible to transfer it to the web page without rewriting the code. Anvil seems to be able to provide web a GUI for Python, but I haven't tried it yet.

trying to implement a search on mongoDB and get the results to display on page [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
search functiondisplays the searchimplements the search
React is completely back-end agnostic. This means you would have to implement the connection yourself.
The regular way is, you setup MongoDB and a Node.js server (or whatever back-end you like) then you connect the Node.js server to MongoDB (via MongoDBs JavaScript SDK) and your React client, which runs in the browser to your Node.js server (via HTTP, express framework could help here).
Browser -> Node.js -> MongoDB.
But MongoDB also has a REST interface you could use directly via the browser, like it's mentioned in the following answer:
https://stackoverflow.com/a/16277603/1016383
Would probably be okay for small proof of concepts or experiements,.

How to setup a stand alone Web application testing environment? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I am pretty new to web application development and testing,currently working on a project which requires me to set up a stand alone environment for testing the Web application. The idea is web application should be testable and the server should be in simulated mode.
As, i was researching came to know that one of the ways it can be done is by node.js which can help in server application for the web app and data can be sent to Web application by JSON.
Please let me know if there is a better way to test standalone web application. All possible ideas are welcome.Please suggest.
It should pretty same as how you setup your production server but test server should have its own database instance and should collide with production data.I didn't get the point about using nodejs. ?? Your tech stack should be same as the production tech stack. Then only it will be called simulated environment.

JavaScript WebApi references: where to store them? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Im new to javascript and want to start writing code as clean(correct) as possible. I use C# WebApi as backend and simple pure HTML + JavaScript project for frontend.
Up until now I stored configuration for my frontend in javascript files like this:
var serviceUri = 'http://localhost:666/api/service';
And just use them somewhere.
In real applications this should be outside any javascript files, at least in my opinion. Similar to how I do it with .NET stand-alone applications or WCF services. How I should store this kind of configuration for frontend application? What is best practises?
You do not need to specify the server location of the web api in javascript. If you just use var serviceUri = '/api/service'; it will take the current server location of your page.
And if you are using static files the problem that you have to change the service location both in the js and the web api will remain and cannot be get rid of without you implementing your own compile tools (which will be a pain in the ass to find the correct routing and so on).
In the enterprise solutions I've worked on we just deal with it. You could create a js file to have all the api endpoints in one place but this could easly get ugly when there are to many.

Add angular2 into existing nodejs app [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I was given an existing big ass nodejs app which contains both the UI and the back-end logic. I would like to split them up and am thinking of using AngularJS 2 for the UI part.
I have gone through some of the examples and know my way around Angular. However I do not know how to properly install it on the existing nodejs app - what do I include in the package.json .... what do I do with the systemjs.config.js, tsconfig.js and typing.json ? How to include the "typescript" parsing/compilation ?
Thank you
P.S. the nodejs app is running sailsJS framework.
I think you need to split the app into 2 layers (assuming this is possible):
1) the REST service layer
2) the Angular2 Front End layer
Node.js (maybe with the help of express) would run the REST service piece.
Angular2 would be the Front End part, calling the REST services offered by the Node server.
In such a scenario you would not have to 'install' Angular2 on Node. You rather would have to prepare a development environment (I suggest to use also Angular2 CLI) for Angular and start the development against the available services. Unfortunately these means that it may be difficult for you to reuse whatever pure FE logic has been developed so far (maybe with the exception of the css part).
I hope this helps

Categories