seejay / OnlinePythonLinterSyntaxChecker

Online Python Editor With Live Syntax Checking and Execution

Home Page:https://pythonbuddy.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PythonBuddy ๐Ÿ–Š๏ธ ๐Ÿ

Travis branch
Online Python 2.7 Programming with Live Pylint Syntax Checking!

###Usage

  1. Fetch from repo:
git clone https://github.com/ethanchewy/OnlinePythonLinterSyntaxChecker.git
  1. Change to directory
cd OnlinePythonLinterSyntaxChecker
  1. Create virtualenv based on your own system:
virtualenv -p /usr/bin/python2.7 venv
  1. Activate vitrual environment:
source venv/bin/activate
  1. Pipe requirements to venv folder:
pip install -r requirements.txt
  1. Set FLASK_APP variable:
export FLASK_APP=app.py
  1. Run flask app:
flask run

Open your browser to localhost:5000 . Voila! ๐ŸŽ‰ ###Current Features:

  • Live Syntax Checking
    • Uses Pylint as checker (only prints out errors and warnings)
    • Syntax Highlighting
  • ![](pybuddy2.gif)
  • Python 2.7 Execution
    • Python 2.7 Complilation
    • Basic Sandboxing
  • ![](pybuddy3.gif)
  • Live Error Table with Additional Help Suggestions
  • ![](pybuddy4.gif)

    ###Customizing Options

    1. Edit app.py to change any pylint options (like showing/hiding hints warnings)
    2. Want Python 3?
    3. Change step 2 from the installation instructions to:
      virtualenv --python=/usr/bin/python3.2 venv
      
    4. Follow rest of instructions
    5. Security
    6. To create a much more secure Python Environment, consider using RestrictedPython: https://github.com/ethanchewy/OnlinePythonLinterSyntaxChecker/tree/restrictedpython
    7. For more security but enough flexibility, you could restrict the temp.py python file without read/write permissions via these instuctions: http://stackoverflow.com/questions/186202/what-is-the-best-way-to-open-a-file-for-exclusive-access-in-python

    ###Future Goals:

    • Make easily embeddable for MOOCs like edX and other education platform
    • Stricter Python Sandboxing via Pypy's sandboxing solution
    • Lower CPU usage
    • Allow users to generate a link to a unique code snippet similar to JSBin

    ###FAQ: Why did you make this?
    I made this so that MOOCs like edX or codecademy could easily embed and use this on their courses so students wouldn't have to go through the frustrations of setting up a Python environment and jump right into Python programming. Also, professors and teachers could easily set up a server and allow students to quickly test out their code with PythonBuddy online.

    Has anyone created anything like this before?
    There has never been a live syntax checker for python online. Similar projects that are not "live" are http://pep8online.com/ and http://antares.sip.ucm.es/cesar/pylint/

    Has can I contribute?
    You can ๐ŸŒŸ star my repo, fork my repo, submit a pull request, and/or open issues!

    Where's the code for embedding it in MOOCs?
    I'm currently working on this over here (for edx specifically): https://github.com/ethanchewy/pybuddy2.0 . If you want to embed this project directly to your site, you would use an iframe:

    <iframe src="https://pythonbuddy.com"></iframe>
    

    I want the code to actually compile and run in a certain way? If you want to actually execute the python safely look at my XBlock code: https://github.com/ethanchewy/pybuddy2.0 . Remember to sandbox the code with RestrictedPython or something.

    How do I run my own server? https://github.com/ethanchewy/OnlinePythonLinterSyntaxChecker/wiki

    ###Credits: This was made by Ethan Chiu as a research project under the guidance of Wellesley College professor Eni Mustafaraj.

    About

    Online Python Editor With Live Syntax Checking and Execution

    https://pythonbuddy.com/

    License:BSD 3-Clause "New" or "Revised" License


    Languages

    Language:HTML 47.8%Language:Python 41.0%Language:CSS 11.1%