Is there pluggable online python console? - python

I'm thinking if there already is some sort of online live python console (web-based) with open source code available. Anyone know of anything?
It would be really useful to have console in Django admin (like running python manage.py shell on the server's terminal), so it would be great to have django/any wsgi aplication, that can be used to enable web based live console access.
Thanks

You're looking for the Werkzug debugger.
http://werkzeug.pocoo.org/
http://werkzeug.pocoo.org/docs/debug/
It's got an interactive javascript based in-browser debugger for your WSGI projects, among many other great tools. Fantastic stuff.
For Django specifically, there's also RunServerPlus, which is part of the django-extensions package.
https://github.com/django-extensions/django-extensions

You should check out Python Anywhere. You can run python web apps, you get an SQL database, and you get a bash shell in your browser.

Have a look at python shell from Google. There's a link to source code at the top. Loading Django environment into it might be not very easy but I believe it's possible.

I'm not sure if this meets your desire but you might take a look at Chrome extension : https://chrome.google.com/webstore/detail/gdiimmpmdoofmahingpgabiikimjgcia

There is a great website called Codecademy. It teaches the fundamentals of Python, Ruby, Javascript, and HTML/CSS.
They also have online consoles for each of the languages they teach, excluding HTML/CSS. This website is Codecademy Labs. Codecademy Labs has a console you can type directly in, and an editor that displays output in the console. I hope that this helped you find what you were looking for!

Related

Dynamically updating web app to monitor progress of python script? Through Web.py perhaps?

I've got a python script that I want to build a locally-hosted web gui app for, so I can use the modern styling and tools available to web apps.
The scripts I'm running take a while to process, and I want to update the web app with visual updates, or at least something akin to what the console sees when using print() in python.
My initial hosting efforts have been based on this tutorial, and I tried out the methods in this answer to try and get data to update in a streamed fashion, but the pages only showed once the entire script was finished.
I'm wondering whether web.py could help me?
Any guidance, or even the right terms to google would be appreciated. Thanks.
--
Update: I've been reading up on node.js (something I've failed to do for years..) and, please correct me if I'm wrong, but it seems like it could be the answer. I'm even considering re-writing my original functions into node.js given the existence of this serial comms library

How to use python to do the web development (or how to set uo cgi)

As the title said, just wonderring how to use python or anyhow to include executable python script into HTML
Using django to do this.
django official web:
https://www.djangoproject.com/
I would look into the python documentation here for learning about Python in the web. But more specifically, there is documentation here explaining Common Gateway Interface (CGI) and how to use it. I recommend looking into this first because I am unsure what exactly you need help with, if it is simply wondering how it works, then these links will explain that just fine.
Flask is very simple micro framework for writing web applications in python.
http://flask.pocoo.org

How to make .py Python files actually execute in the browser?

I have tried searching online like crazy with no avail. PHP is as simple as naming the file .php and writing PHP. I know people say it's that simple for Python, but I have found no useful guides in setting it up. I merely want to practice Python on my computer via WAMP or another alternative. I am on Windows Vista.
I cannot get .py files to execute correctly. The actual text:
print("Hello!")
Appears just as that rather than "Hello!". I don't know what to do to make it actually work in my browser.
Any help or pointing towards guides would be greatly appreciated.
PHP does not execute in the browser. It is executed on the server side then the output is sent by the web server to the browser.
If you want a simple way to use Python to process web requests take a look at web.py (http://webpy.org).
Your server should handle Python code. Take a look at framework Django. And as for servers I can suggest you http://webfaction.com

adding browser capability to an existing python script

In essence I want to run existing python scripts through a web browser, display the text and plots(if any) and also keeping the ability to run them through the command line.
I am wondering is there any toolkit that can help me with the development.Also it would be nice if the toolkit does or allows JavaScript based interactive plots.
Thanks!
-Abhi
WSGI is designed for just this purpose - it provides an interface for a web server to initiate python scripts.
You probably don't want to work with WSGI in the raw. Flask is a straightforward, simple framework you might use for this.
The details of how to actually build a WSGI web server are well beyond the scope of a stackoverflow answer - you can find plenty of tutorial docs on Flask's website.

Plone plugin, web interface development for commandline programs

I am considering to write a plugin/module for one of any of wellknown CMSes like Joomla, Drupal and Plone. I am very impressed with the clarity of many Plone-based sites, and excited with many praises people gave to Plone. Besides, I love Python also. So, I want to give Plone a try. Here a some information about the plugin I want to develop:
I have some Linux commandline programs that I want to run from within the CMS environment via this plugin. The plugin then save command output, run log to the user who runs the programs. The CMS then can take the information and do all other kinds of things like graphical display of data in with graphs, or integrate with search functionality.
So, what do you think? Where should I start? I looked at table of contents for some Plone books but could not find anything close to plugin development.
I think you can't go much wrong with Aspeli's Professional Plone Development, but if you can get a cheap copy of the Definitive Guide to Plone, that'll do, even if it hasn't been updated for Plone4.
We do this all the time.
Plone is written is Python and can do everything what Python can. Python has gained popularity, on expense of Perl, as UNIX scripting language.
For further ideas, if you need to run long tasks, see Long running Plone operation with AJAX progress bar because you usually don't want to block the page loading for the duration of command-line program run.

Categories

Resources