All Projects → ethanchewy → Pythonbuddy

ethanchewy / Pythonbuddy

Licence: bsd-3-clause
Online Python Editor With Live Syntax Checking and Execution

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pythonbuddy

Simple Java Text Editor
📝 PHNotepad is a simple Java text/code editor (notepad) written in Java. It has also nice features such as Search tool, Find/Replace text/code, Auto completion, Nice Image Buttons for better UX, etc.
Stars: ✭ 128 (-42.6%)
Mutual labels:  editor, text-editor
Pell
📝 the simplest and smallest WYSIWYG text editor for web, with no dependencies
Stars: ✭ 11,653 (+5125.56%)
Mutual labels:  editor, text-editor
Cells
Live coding environment. Use SuperCollider, Python, TidalCycles, Node.js etc. in the same project.
Stars: ✭ 133 (-40.36%)
Mutual labels:  live, editor
Left
Distractionless Writing Tool
Stars: ✭ 1,538 (+589.69%)
Mutual labels:  editor, text-editor
Slate Plugins
A set of my personal Slate editor plugins, in a monorepo.
Stars: ✭ 191 (-14.35%)
Mutual labels:  editor, text-editor
Mg
Micro (GNU) Emacs-like text editor ❤️ public-domain
Stars: ✭ 117 (-47.53%)
Mutual labels:  editor, text-editor
Oni
Oni: Modern Modal Editing - powered by Neovim
Stars: ✭ 11,466 (+5041.7%)
Mutual labels:  editor, text-editor
O
🌀 Text editor suitable for writing git commit messages and editing Markdown files. Can build executables and jump to errors at the press of `ctrl-space`, for several programming languages. Can format code with `ctrl-w`. Provides general syntax highlighting, rainbow parenthesis and cut/paste portals. o is intentionally limited to VT100.
Stars: ✭ 54 (-75.78%)
Mutual labels:  editor, text-editor
Nib
Wysiwyg / Text editor components built using React and Prosemirror
Stars: ✭ 181 (-18.83%)
Mutual labels:  editor, text-editor
Bim
small terminal text editor with syntax highlighting
Stars: ✭ 174 (-21.97%)
Mutual labels:  editor, text-editor
Dte
A small, configurable console text editor (moved to https://gitlab.com/craigbarnes/dte)
Stars: ✭ 98 (-56.05%)
Mutual labels:  editor, text-editor
Avaloniaedit
Avalonia-based text editor (port of AvalonEdit)
Stars: ✭ 201 (-9.87%)
Mutual labels:  editor, text-editor
Kodeweave
HTML/CSS/JS and Markdown Playground For Web Designers and Developers
Stars: ✭ 87 (-60.99%)
Mutual labels:  live, editor
Notepadqq
A simple, general-purpose editor for Linux
Stars: ✭ 1,738 (+679.37%)
Mutual labels:  editor, text-editor
Gistlyn
Run Roslyn Gists
Stars: ✭ 75 (-66.37%)
Mutual labels:  online, editor
Lime Qml
QML frontend for LimeText
Stars: ✭ 150 (-32.74%)
Mutual labels:  editor, text-editor
Femto
A toy text editor with no dependencies written in Ruby
Stars: ✭ 34 (-84.75%)
Mutual labels:  editor, text-editor
Remirror
ProseMirror toolkit for React 🎉
Stars: ✭ 973 (+336.32%)
Mutual labels:  editor, text-editor
Pythonvscode
This extension is now maintained in the Microsoft fork.
Stars: ✭ 2,013 (+802.69%)
Mutual labels:  linter, editor
Sapling
A highly experimental vi-inspired editor where you edit code, not text.
Stars: ✭ 195 (-12.56%)
Mutual labels:  editor, text-editor

PythonBuddy 🖊️ 🐍

Travis branch Donate
Online Python 3 Programming with Live Pylint Syntax Checking!

Usage

  1. Fetch from repo:
git clone https://github.com/ethanchewy/PythonBuddy.git
  1. Change to PythonBuddy directory
cd PythonBuddy
  1. Create virtualenv based on your own system:
python3 -m venv venv
  1. Activate virtual environment:
source venv/bin/activate
  1. Enusre that your virtualenv uses Python 3.7.6 via this command:
python --version

If you don't use Python Python 3.7.6, some Python libraries that PythonBuddy relies on may not work. Please refer to this documentation for figuring out how to create a specific version of Python via vitualenv via this StackOverflow post.

  1. Pipe requirements to venv folder:
pip install -r requirements.txt
  1. Change to the PythonBuddy application folder. You should now be in PythonBuddy/PythonBuddy/.
cd PythonBuddy
  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


Python Execution
  • Python Complilation
  • Basic Sandboxing


Live Error Table with Additional Help Suggestions


Secure (Sandboxed) Version using Docker

Please check out PythonBuddySandboxed for a fully working web implementation which uses a dockerized version of PythonBuddy called PythonBuddySandbox.

This builds off of christophetd's docker-python-sandbox and just modifies it so that it runs pylint in the background and processes the pylint messages on the client side.

To see how he implements it on the web side, please check out https://github.com/christophetd/code-execution-api-demo

This is still in alpha stage so there might be some bugs. If you want to implement this please check the 4 links above since documentation is a WIP.

Customization Options

  1. Edit app.py to change any pylint options (like showing/hiding hints warnings)
  2. Security
  3. To create a much more secure Python Environment, consider using my Docker + Node.js implementation: https://github.com/ethanchewy/PythonBuddy#secure-sandboxed-version-using-docker
  4. For versions that used Python 2 or to see older versions, check: https://github.com/ethanchewy/PythonBuddy/releases

Unit Tests

To run tests, run this at the root directory:

pytest

For coverage run the following command in the root directory:

pytest --cov-report html --cov=PythonBuddy tests/

Future Goals:

  • Make easily embeddable for MOOCs like edX and other education platform
  • Create an analytics system that models the student's python learning and tells them where they need improvement (many programming students learn by copying and pasting and don't actually understand the nuances of the Python language).
  • 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
  • Unit tests for client side JS

FAQ:

Why did you make this?
In 2014, I was a Community TA at MIT edX 6.00.1x course where I helped teach over 1000 students. The year after I started researching under Prof. Eni Mustafaraj. She had a data set from that course and we saw a high attrition rate of students within the first 2 weeks. After digging through the curriculumn and data, I realized that the students left because of difficulties setting up their Python environment and complex error messages that they couldn't solve when running their code (ex: some students had path issues).

So, I created PythonBuddy to address this issue so that students wouldn't have to go through the frustrations of setting up a Python environment and running into seemingly "random" bugs. PythonBuddy allows users to jump right into Python programming with the support of live syntax checking & highlighting. 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/

How 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?
To run PythonBuddy securely, you can check out my implementation of PythonBuddy with Docker and Node.js: https://github.com/ethanchewy/PythonBuddy#secure-sandboxed-version-using-docker. Basically, it dockerizes each user session (similar to creating a virtual machine for each user) and destroys it if it uses too much memory or runs malicious code.
If you want to actually execute the python in a restricted fashion at my Restricted Python branch: https://github.com/ethanchewy/PythonBuddy/tree/restrictedpython.

How do I run my own server? Regular: https://github.com/ethanchewy/OnlinePythonLinterSyntaxChecker/wiki
Sandboxed: https://github.com/ethanchewy/PythonBuddy/wiki/Running-Sandboxed-PythonBuddy

Press:

Featured on FlaskCon 2020, Python Weekly, CSS Author, and the Talk Python Podcast

Credits:

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

Other:

As of October 2020, PythonBuddy.com will no longer be a demo server for this open-source project due to the increasing costs of hosting it for 80,000+ people monthly. Instead, this URL will redirect back to this GitHub repo.

How can I support PythonBuddy?

If you enojyed using this open-source project, please consider donating whatever you can to these organizations that address problems I'm passionate about:

If you don't have the means to donate to the above, consider checking out some of these free action items and information:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].