Coder Social home page Coder Social logo

adamshovav / live-py-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from donkirkby/live-py-plugin

0.0 2.0 0.0 1.51 MB

Live coding in Python implemented as an Eclipse plug in.

Home Page: donkirkby.github.com/live-py-plugin

License: Other

Emacs Lisp 3.46% Python 69.58% Java 26.96%

live-py-plugin's Introduction

live-py-plugin

Build Status Code Coverage

Live coding in Python implemented as an Eclipse plugin or an Emacs minor mode.

To see how to use it, watch the demo video or read the getting started page. You might also find some useful examples in the tools folder. To learn more, read about how it works.

Screenshot of a star diagram

Special thanks to Antti Kaihola and Christoph Paulik for contributing the Emacs support. Thanks to all the contributors for helping in all kinds of ways.

If you like this project, check out some of my other projects.

Installing the Eclipse plugin

  1. Install the PyDev plugin and Eclipse if you don't already have them. It's been tested with PyDev 4.5.5, Eclipse 4.4, Python 2.7 and 3.4. It seems to be particularly sensitive to changes in PyDev.
  2. In Eclipse, choose Help: Eclipse Marketplace... from the menu.
  3. Search for Live Coding in Python, and install it.
  4. Restart Eclipse.
  5. Open any Python file, and from the Live Coding menu, choose Start Live Coding. You should see an extra panel on the right that shows the results of running your code.
  6. To try the turtle graphics features, open the Live Coding menu, and choose Start Live Turtle. The panel on the right shows the turtle graphics display.
  7. You can also use another script or a unit test to drive your live code. Run your driver script or unit test as usual in Eclipse, then click on the small arrow next to the big live coding arrow in the toolbar. You should see all the different Python and unit test launches listed there. Click on the one you want, and it will call the live version of your code. To run a single unit test method, open the test file, and type Ctrl+F9, then choose the test method you want to run. Edit your run configurations to give the new configuration a meaningful name, then choose it from the live coding arrow's menu.

If you don't want to use the Eclipse marketplace, you can also install from the update site.

Uninstalling the Eclipse plugin

  1. In Eclipse, choose Help: Installation Details from the menu.
  2. Select Live Coding in Python, and click the Uninstall... button.
  3. Restart Eclipse.

Installing the Emacs mode

It's probably easiest to use the MELPA package archive, as described in this section, but the next section gives instructions for installing without MELPA.

  1. Install GNU Emacs if you don't already have it.
  2. Install MELPA. You probably want to follow the instructions for the stable version, instead of the default bleeding-edge version.
  3. Launch the package installer with M-x package-list-packages.
  4. Find the package with C-s live-py-mode.
  5. Mark the package to install with i, then execute the installation with x.
  6. Open any Python file, and activate live-py-mode with M-x live-py-mode. You should see an extra window on the right that shows the results of running your code.
  7. Type C-h m and scroll down to the Live-Py section to see all the advanced features that let you run other versions of Python or drive your live coding from another script or a unit test.

Installing the Emacs mode without MELPA

  1. Install GNU Emacs if you don't already have it.

  2. Clone the latest version of the live-py Emacs mode:

     git clone https://github.com/donkirkby/live-py-plugin.git
    
  3. Copy the Emacs Lisp file and the supporting Python files into a directory which is in your Emacs load-path. For example:

     cd live-py-plugin
     cp emacs-live-py-mode/live-py-mode.el plugin/PySrc/*.py ~/.emacs.d/
    

    Add ~/.emacs.d/ to your load-path in ~/.emacs.d/init.el or ~/.emacs:

     (add-to-list 'load-path "~/.emacs.d")
    
  4. Load the Lisp library in your ~/.emacs.d/init.el or ~/.emacs:

     (require 'live-py-mode)
    
  5. Restart Emacs.

  6. Open any Python file, and activate live-py-mode with M-x live-py-mode. You should see an extra window on the right that shows the results of running your code.

  7. Type C-h m and scroll down to the Live-Py section to see all the advanced features that let you run other versions of Python or drive your live coding from another script or a unit test.

Uninstalling the Emacs mode

If you installed with MELPA, just use it to uninstall. If not, follow these steps:

  1. Remove the files you copied into ~/.emacs.d/:
  2. Revert additions to ~/.emacs.d/init.el or ~/.emacs.
  3. Restart Emacs.

Working Features

  • turtle graphics, including filled polygons (Eclipse only)
  • local variable assignments
  • looping
  • function calls, and multiple calls.
  • compile errors
  • runtime exceptions
  • infinite loops halted.
  • print statements work.

If you find the project useful, help us make it better.

live-py-plugin's People

Contributors

akaihola avatar brandm avatar cpaulik avatar donkirkby avatar fabioz avatar purcell avatar syohex avatar zhenglinj avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.