I would like to create a kiosk application that wraps a web browser and enables extensions.
This application needs to be launched at startup of windows 10 pro. It has to display a web page and an extension that hide html elements like buttons and links.
I have tried to develop a little application with python and selenium. It actually works but the application start too slow and shows the desktop. I tried some startup application mechanism on Windows but none of them can launch the application fast enough to hide the desktop.
Now I am following the uwp way. It solves all the problems about the kiosk implementation but with WebView2 I think I cant use extensions. I was thinking about injecting javascript code on the fly but I dont now how to do it or if it is possible.
You can use WebView2's ExecuteScriptAsync(string) method to run JavaScript.
i am trying to take user inputs in a popup and i have tried so many ways i.e. external libraries of python that works with GUI (tkinter, pyqt, easygui etc. etc. etc.)
Is there any way to do the same without such GUI library ???
And the reason i want to avoid these GUI lib is: i want to use this feature on multiuser web application running on linux remote server, and there is problem of DISPLAY variable on it.
If anyone going to suggest for this DISPLAY error solution with ssh X forwarding, then as i said its multi user web application, how would it be possible to forward DISPLAY to multiple users ???
I will be glad if i can find the answer of first question of having a solution to do without any external GUI lib .... thanks
I have few scripts written and trying to map those scripts with web page so that any user want to run a script just need to click the button on the web page and script will run at background, output will show on the web screen...
I have no idea how to proceed on this. Can someone help me ??
For you to accomplish this you will need to write some backend code that initiates your script from your webserver. This is because your browser can only run JavaScript. Python would have to run on the webserver.
There are many Python frameworks that can make this task easier such as Django, Bottle and Flask.
I finished up some python tutorials and would like to go a bit further. I can open the IDLE and execute the code just fine by pressing f5 (save and run) on my desktop but that is the limit of my abilities. I would like to be able to execute the programs on a webpage
I tried simply uploading the file to my server, then browsing to it in chrome. I'm sure you know what happened: the url displayed text on the screen.
Since I am brand new to python, I am not sure where to start or even what questions to ask. Basically I would like to run the program in the browswer as if the browswer was the IDLE, or better yet, create an html/css button that runs the program when clicked.
I'd advise you to look into something like flask. It's a micro-framework that includes a basic web server. The documentation should get you most of the way that you want to go.
Running python on the web usually means that when you hit an URL, the server runs some kind of python script, and returns a string - the HTML content of the page you're requesting. You can't use python to 'script' the webpage as you'd use javascript.
You can run python in an interactive interpreter running within a webpage though - just check out try ipython.
Flask is good.
Cherrypy - http://www.cherrypy.org/ - is also a great choice for a really simple way to run python on the server.
Fundamentally, you just configure your web server to execute the file instead of display it. Typically you set this for *.py files but you could restrict it, say, to files in a particular directory. Apparently, your server already has such a setting for PHP files.
Wrapping Python with PHP (obviously) adds neither speed nor security or utility.
Down the line you might want to look at frameworks, mod_python, WSGI, etc, but for your immediate problem, those are severe overkill.
This is limited to static server-side code; JavaScript runs interactively in the visitor's browser, allowing for much richer user interaction. A server-side script runs when the browser attempts to load the page, and the page load finishes when the script is done. If you want something like IDLE in your browser, that's a JavaScript challenge rather than a Python task (and that particular wheel has already been invented, productized, marketed, and sold to the Americans: http://pythonfiddle.com/)
like this:
python -c "import urllib2; exec urllib2.urlopen("http://localhost:8000/test.py").read()"
I'm already implement a command line tool used for 802.1x authentication in python. But I want a gui frontend. I want to try a web UI this time, but I don't know how to let my webui communicate with my python app.
I only know that I need to open a socket in CLI program and receive the message send by the web ui. But I'm a newbie in web development. I don't known what to do with my web app.
Do you have any good advice? Thanks in advance.
Python official wiki page about web programming and the wikipedia list of the web frameworks written in Python are good places to start from.