PythonBuddy ๐๏ธ ๐
Online Python 2.7 Programming with Live Pylint Syntax Checking!
###Usage
- Fetch from repo:
git clone https://github.com/ethanchewy/OnlinePythonLinterSyntaxChecker.git
- Change to directory
cd OnlinePythonLinterSyntaxChecker
- Create virtualenv based on your own system:
virtualenv -p /usr/bin/python2.7 venv
- Activate vitrual environment:
source venv/bin/activate
- Pipe requirements to venv folder:
pip install -r requirements.txt
- Set FLASK_APP variable:
export FLASK_APP=app.py
- Run flask app:
flask run
Open your browser to localhost:5000 . Voila! ๐
###Current Features:
- Uses Pylint as checker (only prints out errors and warnings)
- Syntax Highlighting
- Python 2.7 Complilation
- Basic Sandboxing
###Customizing Options
- Edit app.py to change any pylint options (like showing/hiding hints warnings)
- Want Python 3?
- Change step 2 from the installation instructions to:
virtualenv --python=/usr/bin/python3.2 venv
- Follow rest of instructions
- Security
- To create a much more secure Python Environment, consider using RestrictedPython: https://github.com/ethanchewy/OnlinePythonLinterSyntaxChecker/tree/restrictedpython
- 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.