Skip to content

A simple django-based interactive website to execute any python scripts

Notifications You must be signed in to change notification settings

yuanxu-li/django-script-runner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Script Runner

Django Script Runner is a django-based web application, where you can run and demonstrate your Python script in an interactive way.

It can be used in the following scenarios:

  • demo your course/work project
  • build a simple web app with a useful python script of your own
  • educate yourself or others

Important links

Usage

Assume you want to demonstrate a multiply function of three floats

Installation

> git clone [email protected]:yuanxu-li/django-script-runner.git

Update

> vi django-script-runner/scripts/scripts.py

Or use your favorite IDE to update the run function in django-script-runner/scripts/scripts.py.

The original file is

def run(a, b):
    return int(a) + int(b)

Let's update it to

def run(mul_1, mul_2, mul_3):
    return float(mul_1) * float(mul_2) * float(mul_3)

Rules of updating the function:

  1. Variable names and number of variables are changeable, such as
  2. Variables are always strings, and thus you should always cast the variables to the desired format

Run

> python manage.py runserver

The prompt will tell where to find the web app. Usually it is http:https://127.0.0.1:8000/ Then you can type in three variables in the form, and click "Submit" to get your result back, as seen here

Team

Errors / Bugs

If something is not working correctly, or if you have any suggestion on improvements, report it here

Copyright

Copyright (c) 2020 Justin Li. Released under the MIT License

Third-party copyright in this distribution is noted where applicable.

About

A simple django-based interactive website to execute any python scripts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published