I have this code that detects face and eyes ( face recognition ) and it runs in python and appears in pycharm when it run as a cam window ,so I am asking how to add this window as a part of a web page project that is written in html css and javascript so it appear as a part of the web page
You'd need to use the Flask or Django lib for python to do this. More info about Flask can be read on their website: https://flask.palletsprojects.com/en/2.0.x/
I've never tried Flask with JavaScript, but I do know that python is the better than for example PHP
Related
I'm working on a twitch.tv overlay that generates a word cloud live on-screen based on what I've been saying on stream.
I'm currently using Visual Studio Code with Live Server to display a file via an HTML file alongside a Python script that generates a new png file of the word cloud, using the same filename.
Using the Live Server extension is nice, but I can't help but feel like it's sort of a dirty solution. Any ideas on something more formal?
NodeJs and Express could be a good option. The server could be written in Javascript and you could use a sub-process to call your python script on an interval.
I do have simple coding skills. I don't know too much about web development, only the very basics. I usually code in python and never have to use JavaScript or HTML.
So I made a game using Godot. And I exported my game with the html5 export.
It gave me
index.html
index.js
index.pck
index.wasm
favicon and PNG
I uploaded my game on itch.io, and they just needed a zip file of the above, but now I want to host the game on my own website.
I want to know the both methods of running the code in a small box on the website kind of like how it plays on itch and a way of playing just the app on the whole web page.
Likewise, I did try to research this online, but currently what I lack is how to describe this issue? Because all I search is how to run index.html file or how to implement that HTML in another HTML.
Which as you can guess gave me varied results from which none of them solved the issue and I realized that describing my issue here would be the best thing to do.
Oh, and I'm not going to make only games, so please don't give an answer that works specifically for games.
As you code in python you should know that you can start a local web server in python for testing purposes.
You can start a server by running the command in the directory where all the files for game are located
python -m http.server 80
Where 80 is the port
And navigate to localhost:[port] in your browser
And to stop the server just press ctrl + c in terminal
I am really new to android and I am building an app that will take the username and password of a website(https://lms.mrt.ac.lk).
When the user hits the login button of my android app, the app should itself logged in to the above website and retrieve the complete(including js generated html) html source code.
As a start I tried to print the html source code in the android studio. I tried to use HtmlUnit, but later I found that it is not supported by android. Then, I tried to use Selenium on android, but when tried to build the project it gave me an error "More than one file was found with OS independent path 'META INF' ".
And then tries android's WebView to do the thing, as described in this question, but I don't know how to view the complete html output.
So, my question is -
How to login to a website inside an android app
How to get the complete html source code of the logged in website in android(scraping the js)
I want to do the above in same app. I searched everywhere and still could not find anything complete, that helps a beginner.
Please help me! your suggestions/solutions are highly appreciated.
I'll answer your questions in order.
I don't know what javascript android framework you are using, but the solution should be similar to the java solution. For your specific website, the login endpoint is https://lms.mrt.ac.lk/login.php. You should send a POST request to the endpoint with header parameters LearnOrgUsername and LearnOrgPassword. On success, this should return your desired LoginSessionCookies.
Instead of trying to interpret the javascript stuff, you should rather try to understand how the javascript code retrieves the information you need. And then directly access your information by a web request.
I'm currently working on a ionic app with Visual Studio. My final goal is to open a MDB database (Microsoft Access) that is located in a distant server. I suppose that I have to use a PHP file to accomplish it.
So I have a lot of questions:
- Is it possible to communicate with a MDB file througt JS in a Cordova app?
- How to include the PHP file to my JS?
Thank you in advance and sorry for my english, I'm not a native.
If you want JS to be able to talk to or change a MDB database, you'll need to build a PHP page on your web server that talks to the MDB database instead, and then talk to the PHP page with Cordova/JS.
Examples:
https://www.sitepoint.com/using-an-access-database-with-php/
Your PHP page should return JSPONP though (not regular HTML), and you can call your PHP page via jQuery. Here are other examples:
Simple jQuery, PHP and JSONP example?
I was wondering I have PHP based server side stuff that accepts ajax requests and sends back JSON for JS. And I have HTML and JS based "client" now I would like to create exe(windows aplication) that would look the same as the "client" in browser but without browser. Preferably somehow grab that HTML and JS and "compile it" to regural client that would still send out AJAX calls and procesing JSON data.
Edit:
To clarify things:
Server(on webserver) is PHP procesing incoming AJAX calls and diplaing JSON as result.
Client(what I want to convertt to exe) is HTML and JS(Jquery) page(application).
I want for user to have option two to dowload client for windows so he/she dont have to use browser.
With https://electron.atom.io/ from Github you can develop Windows, Mac and Linux applications with Javascript, Html and CSS. You can also build mobile application with your web development skills. https://cordova.apache.org/.
You can use Electron, but if you just want something quick and easy to use, try Scriptonit. It's exactly for this kind of use. (Check out the documentation and the examples to see if this is the one for you.)
It's basically one exe plus a few sidecar files in a folder called app/, then it just works like a local browser without the frames & head. Also, it can access local files and run OS commands, even capture their output.
Side note 1: Yes it's mine, as you can see on the link - but no, that's not why I'm recommending it
Side note 2: It's 0.9 so it's not perfect, let me know if it misbehaves.
I don't think you can make a desktop application with markup languages. but then am also a newbie in this stuff but what I think you need is to develop a GUI in a programming language like java for example Swing docs.oracle.com/javase/tutorial/uiswing/ to mimic the apearance of your webpage. Then connect to your server by socket programming.