Skip to content
/ pythy Public

Pythy – the Cloud-Based IDE for Novice Python Programmers

Notifications You must be signed in to change notification settings

web-cat/pythy

Repository files navigation

Pythy -- The Cloud-Based IDE for Novice Python Programmers

Pythy is a web-based programming environment for Python that eliminates software-related barriers to entry for novice programmers, such as installing the language runtime and IDE and properly configuring other dependencies. Within seconds, students can begin writing code, watch it execute, debug it, and access support materials and tutorials, all from within the familiar context of their web browser.
For more information please see the slides and the paper

Setup Instructions

Dependencies to be installed manually

  1. Ruby
  2. The Ruby on Rails framework.
  3. Mysql client and server. (For linux install the dev packages also.)
  4. A JavaScript runtime (Ex: Node.js)
  5. The Redis server.
  6. The lame mp3 encoder.
  7. Pillow - The Python Imaging Library Fork for server side image processing.
  8. The wave module for server side sound processing.
  9. Imagemagick.

(For an ubuntu installation see Setup Ruby on Rails on Ubuntu)

Linux

  1. Clone the git repository. git clone https://github.com/web-cat/pythy.git
  2. Go into the newly created pythy directory. cd pythy
  3. Install the dependencies. bundle install and npm install
  4. Create a database configuration file at config/database.yml. The adapter must be mysql2 as some of the sql statements will not work otherwise. Sample configuration file.
  5. Create the database. bundle exec rake db:create
  6. Load the schema into the database. bundle exec rake db:schema:load
  7. Seed the database with the initial values. bundle exec rake db:seed
  8. Run the server. rails server
  9. If the server is running locally, visit http://localhost:3000, else, visit the corresponding url.
  10. To be able to use the grading feature, you need to have sidekiq running on the server. bundle exec sidekiq. The sidekiq dashboard can be accessed at /sidekiq.
  11. Start the juggernaut server by running ./node_modules/juggernaut/server.js

Running the tests

The tests are located in the spec directory. To run them, first prepare the test database by running the commands

bundle exec rake db:test:prepare
bundle exec rake db:seed RAILS_ENV=test

Preparing the test database is a one-time operation.

Now, the tests can be run using the command
bundle exec rspec

Running the tests generates a coverage report (using simplecov) that is stored in the coverage directory. Open the index.html file in a web browser to view the test coverage.

Sample Database Configuration File

	development:
    		adapter: mysql2
    		encoding: utf8
    		database: dev_pythy
    		pool: 5
    		username: <your mysql username>
    		password: <your mysql password>
	test:
    		adapter: mysql2
    		encoding: utf8
    		database: test_pythy
    		pool: 5
    		username: <your mysql username>
    		password: <your mysql password>

Objectives and Plans

  • Design as a modern, AJAX-powered Web 2.0 application.
  • Avoid duplicating the traditional IDE model of a project tree, overfull toolbars, and multiple docked views. Instead, take advantage of the existing web browser document and tab model that students are already accustomed to.
  • Store student code in Git repositories; adopt an aggressive auto-saving policy to collect fine-grained data about novices' programming habits and to avoid data loss.
  • Evaluate Javascript-based Python implementations (Skulpt, Pyjs, Pyjaco, others?) to compile/run/debug code entirely on the client, eliminating server-round-trip latency—also to enable highly interactive/graphical assignments that render live in the browser; consider supporting server-side Python/Jython as well.
  • Explore integrating an open-source interactive textbook directly into the application, such as How to Think Like a Computer Scientist: Interactive Edition (Using Pyth on 3.x) (which already uses Skulpt to run the embedded exercises).

Funding

We would like to acknowledge those who have graciously provided funding for our initial work on Pythy—the SIGCSE Special Projects Grants board, which provided undergraduate student wages support for Pythy's initial development, and the Virginia Tech Student Engineering Council, which provided support for purchasing the server hardware for Pythy's deployment at Virginia Tech.