Giter Site home page Giter Site logo

mu-editor / mu Goto Github PK

View Code? Open in Web Editor NEW
1.4K 72.0 429.0 22.99 MB

A small, simple editor for beginner Python programmers. Written in Python and Qt5.

Home Page: http://codewith.mu

License: GNU General Public License v3.0

Python 99.34% CSS 0.46% Shell 0.01% Makefile 0.14% Batchfile 0.01% HTML 0.06%
education editor python micropython circuitpython pygame debugger

mu's Introduction

Mu - A Simple Python Code Editor

image

Mu is a simple code editor for beginner programmers based on extensive feedback from teachers and learners. Having said that, Mu is for anyone who wants to use a simple "no frills" editor.

Mu is a modal editor with modes for many different ways to use Python to create cool and interesting things.

Mu is written in Python and works on Windows, macOS, Linux and Raspberry Pi. The project's public facing website is https://codewith.mu/. We celebrate the work done by users of mu at https://madewith.mu/.

We have extensive developer documentation including a guide for setting up a development environment, contributor guidelines and some suggested first steps.

We want our community to be a friendly place. Therefore, we expect contributors and collaborators to follow our Code of Conduct.

mu's People

Contributors

ambv avatar askvictor avatar bwshockley avatar carlosperate avatar devdanzin avatar dhalbert avatar dybber avatar gigi1111 avatar gquintana avatar gromko avatar hulkco avatar inglesp avatar jg00dman avatar johannaengland avatar keith-packard avatar kkawase0104 avatar knowledgejunkie avatar kushaldas avatar kyoungmeyer avatar ladyada avatar minoruinachi avatar ndevox avatar ntoll avatar stestagg avatar tibs avatar tjguk avatar tmontes avatar vogrosty avatar xbecas avatar zanderbrown avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mu's Issues

Add flash capability

As a user, when I click "Flash", upon first click in the current editor session, I should be asked to identify where, on the file system, the micro:bit is located. Once selected, a .hex file is generated and copied to that location - thus flashing the device. On subsequent clicks the editor remembers the location of the device and misses out the selection step. If a non-micro:bit location is selected, the resulting script_name.hex file is copied to that location.

Add zoom in/out buttons

The functionality for zooming already exists in the code base. See the zoom_in and zoom_out methods in the Editor class in editor.py.

Make REPL text / history READ ONLY

It's possible to move the cursor using the mouse to another location in the text (old output) and start typing. We shouldn't be able to do this! ;-)

Appveyor builds fail due to AWS secret key error

The Windows build appears to work. This is awesome, apart from one fly in the ointment. At the very end the process errors with the following message:

Value cannot be null.
Parameter name: awsSecretAccessKey

While I can see the asset is created, the actual build is marked as failed.

Is there any way to fix this?

Add ability to save the single Python script

As a user, when I click save I expect my code to be saved as a Python script to the file-system.

A decision we need to make is if we just save Python scripts in a sensible default directory (the platform equivalent of ~/MicroPython) or allow the user to choose the file's location. Currently I prefer the latter since it's less thinking on the part of the user, could be automagically turned into a SCM repository and/or is a sensible convention.

Create a new .deb package so the editor is easy to install on Debian based systems.

We should package the "Mu" editor for Debian based systems. This will include Debian itself, Ubuntu and, of course, Raspbian.

The package should have three dependencies: python3-pyqt5, python3-pyqt5.qsci and python3-pyqt5.qtserialport.

We should only package the appropriate parts of this repository. The process for packaging and installing from such a package should be documented in the README here:

https://github.com/ntoll/mu/tree/master/package

Error creating user data under windows

I am getting the following error when running mu under Win10x64.

(mu3) E:\workspaces\git\mu>py -3 run.py
Qt: Untested Windows version 10.0 detected!
Traceback (most recent call last):
  File "run.py", line 2, in <module>
    from mu.app import run
  File "E:\workspaces\git\mu\mu\app.py", line 24, in <module>
    from mu.editor import Editor
  File "E:\workspaces\git\mu\mu\editor.py", line 35, in <module>
    os.mkdir(DATA_DIR)
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Users\\Carlos\\AppData\\Local\\python\\mu'

The folders python\mu are not present in the C:\Users\Carlos\AppData\Local directory, but the application catches the user app data local directory correctly.

Really weird Pi 2 keyboard bug

I am not quite sure how to replicate this specific issues, which I woudn't be surprised if it's not related at all with Mu, but something else going wrong.

Basically I've just done a clean install of raspbian on a Pi2, and installed the required PyQt5 packages, a VNC server, and nothing else. So, when I run Mu the keyboard does not type what it is expected, almost like a different layout is loaded, even though it works perfectly fine on any other app I've tried on the system.

I've created this quick video to illustrate me trying to type display.scroll('test'):
https://www.youtube.com/watch?v=L8lnCOmu8EY

Add ability for user to load an existing Python script.

As a user, when I press the "Load" button I should be presented with either:

  • A list of my existing Python scripts in the default `~/MicroPython' directory, or,
  • If I have no scripts in that location, a helpful message telling me so with instructions on how to create a new script.

Ensure REPL works cross platform.

Currently the REPL only works in Linux. This needs to change so that it works in:

  • Windows 7/8/10
  • OS X
  • Raspberry Pi

Given the cross platform nature of Qt this (hopefully) shouldn't be an onerous task. The major sticking point will be upon device detection.

Unfortunately, Windows does not come with serial/COM drivers for the micro:bit installed by default (happily, Linux and OSX do).

If you're on Windows, in order to make this work you should use the mbedWinSerial_16466.exe file (found here: https://developer.mbed.org/media/downloads/drivers/mbedWinSerial_16466.exe) to install the correct drivers. You MUST have your micro:bit plugged into your computer when you run this command.

For more information and the latest versions of this driver please visit:

https://developer.mbed.org/handbook/Windows-serial-configuration

Save raises error on close

If you close out of the save dialog (click the x, don't actually save) an error is raised:

Traceback (most recent call last):
  File "/home/path/to/mu/mu/editor.py", line 356, in save
    with open(ed.path, 'w') as f:
FileNotFoundError: [Errno 2] No such file or directory: ''

On Ubuntu this just gets handled and the window survives. However this kills mu on windows 10 which will likely hold most of the userbase.

Considering where it is, this could be a very frustrating bug (crashing the program just as you are thinking about saving).

Opening doesn't seem to the same effect on either OS so seems specific to saving.

Document the install process for PyQt5

I'm on Ubuntu and it wasn't the clearest setup (although doesn't take long).

My steps were:

sudo apt-get install qt5-default
sudo apt-get install python3-pyqt5
sudo apt-get install python3-pyqt5.qsci
sudo apt-get install python3-pyqt5.qtserialport

Let me know if anything is missing.

Not entirely sure where this kind of information should be put as well.

SaveAs

Might be me but didn't see a way to save an existing file under a different filename (for version increments etc)

Add keyboard shortcuts

Purely for ease of use.

Basic ideas include new tab, open, save, zoom in and zoom out.

Add REPL toggle

Upon starting the editor, if a micro:bit is already plugged in, the REPL pane should be displayed. If the micro:bit is not plugged in, the REPL pane is not visible. However, as a user, if I click the REPL button the device detection / REPL display code is re-run (if I subsequently plug in the device). If the REPL pane is already visible it is closed (to the bottom of the screen). A subsequent click re-opens it in the state that it was last left in.

Consider pinning all build dependencies

#76 was caused by a new version of pip depending on a version of setuptools that doesn't play nicely with pyinstaller. We should consider pinning all development dependencies to avoid this kind of problem.

Drop file on support

It would be great to be able to simply drop a .py file onto the application in the menu bar. Although not a majorly important feature, it would be great to see it there. Have had a few times so far where I have gone to drop a script on it and then remembered I can't just yet.

Zoom should apply to both editor and REPL

When you click the zoom buttons they only currently apply to the editor. This makes it hard to demonstrate using the REPL if projecting to a room where it's hard to see at the back. Zoom should apply consistently to both elements (editor and REPL) so they're always showing fonts of the same size.

Exit message with unsaved changes can be confusing

The current warning message displays "You have un-saved work!" with the options "Cancel" and "ok". The first time I encountered it I had to think about it twice before realising that "ok" would just allow me to exit without saving the changes.

Instead of changing the button message, which would require modifications to the interface, I suggest to just change the message for now. How about something along the lines of "There is un-saved work, exiting the application will cause you to lose it" ?

Make tabs closeable

Nothing worse then having a load of tabs open and not being able to close them. Especially if they are all untitled!

Ensure mu is accessible.

It is an essential requirement that no-one is excluded from using the micro:bit. This includes those of us who require capabilities built into the editor so it is easier to use. Happily Qt has a comprehensive guide to making this happen. You can read it here:

http://doc.qt.io/qt-5/accessible.html

I believe accessibility should be a core part of our development process and that all the features of mu should be accessible to all users. We should make it a requirement for code-review that there's a step to check accessibility such that our code conforms with the suggestions in the document linked to above.

Add a Quit button

As a user, if I click the "Quit" button the editor shuts down. If I have unsaved work, I am prompted if I wish to save it first.

Decouple view code from business logic

This should make other tickets easier to work on, especially #4 - adding tests

Up for discussion:

  1. Is it worth trying to make this a more functional codebase?
  2. Should we be using QtQuick/QML for view code where possible?
  3. What architecture? MVC, MTV, MVVM, some N-tier architecture?

I'm tempted on 1. and 2. but I'm aware that this would require buy-in from other contributors, and this is not my project. As for 3. I think choosing something and sticking to it is probably more important than getting this decision perfect. I'm tempted for this reason to go MVC as it's common and I think just about everyone has used it in some form.

Add the ability to create a new Python script

As a user, when I click the "New" button I expect to be asked for a name for my new script.

If such a script already exists I should be challenged about this and asked to select to back out or overwrite the existing script.

Upon completion I'm presented with an empty editor ready for me to code in. When I click "Save" the newly created script's name is correctly used.

Add snippets dialogue

As a user, when I click "Snippets" I am presented with a description of what snippets are, a short example of how to use them and a list of available snippets I can use. If I click on one of the available snippets I'm returned to the editor with the snippet inserted where the cursor had last been located.

Zoom_in/zoom_out throws AttributeError for repl

running zoom_in and zoom_out throws an AttributeError for repl:

Traceback (most recent call last):
  File "/home/milo/Projects/mu/mu/editor.py", line 330, in zoom_in
    self.repl.zoomIn(2)
AttributeError: 'function' object has no attribute 'zoomIn'

I'd suggest wrapping the relevant section of code (self.repl.zoomOut(2)) in an if hasattr statement, as is done for the tabs.

Is there a reason why this hasn't been done?

Save As.../Rename

Just wondering along the lines of expected usability.

Would it be worth putting in a save as... method? If someone accidentally named their file something other than expected it would currently prove a minor headache to change the name. Whereas save as... would just be a minor variant of the current save function.

I have two thoughts on this process if we were to implement it:

  1. I don't think we should add an extra button to the toolbar. But maybe have a menu which could repeat a few of the buttons and add extra options (e.g. save as...)

  2. Something fun to code could be a tab renaming option, where double clicking the tab name allows you to rename it.

1 I think could be something very useful.

2 is relatively hidden and is just a small UX enhancement which may go unnoticed, so not really necessary, but then the little things always make the difference.

Any thoughts?

User Help

Perhaps worth thinking about for post V1.0, is some sort of onboarding tutorial, whether it's

  1. a guided tour through the application,
  2. a "tip of the day" feature, or
  3. just a set of help pages that guides you through everything from a beginner's eye view.

These aren't mutually exclusive. 3. is possibly the easiest, 1. is possibly the best for discovery, and 2. isn't a bad half-way house ;)

Mu failing to detect Micro:bit on Linux Mint

Hi

I cloned the repository, followed the instructions and ran Mu on my Linux Mint laptop. I could access and edit the Python file I wanted.

When I clicked on the Flash button I got an error mrssage saying that no Micro:bit was detected.

I tried this with the Micro:bit connected prior to running Mu, connecting it after Mu was started, pressing the reset button on the Micro:bit and disconnecting and reconnecting it. I was successfully able to transfer hex files I had created using the online stuff and one that I created from a python file using the tools in the micropython folder.

At no point did I tell Mu where my Micropython folder was, nor is it in the path. Does Mu need a working Micropython hex file, to function?

Cheers
Dave Ames

Find teachers and other interested people to act as crash test dummies!

We should release early and release often. The sooner we get this project in front of teachers and other potential users the sooner we can get actionable feedback.

We should gather together a cohort of willing crash-test dummies who are willing to feel the pain of pre-Alpha software.

This groups must include:

  • Teachers.
  • Non-technical parents.
  • School technicians and/or sys admins.
  • Classroom assistants.
  • Professional programmers who are not authoring this project.

We should include clear first steps instructions and a well defined mechanism for creating feedback and interacting with the project.

'nuff said. :-)

Serial escape character support

It would be great if Mu supported escape characters/sequences. For example, the following appears red and bold in GNU Screen from a Microbit but it is output raw in the REPL in Mu.

print("3033[1;31mHello World3033[0m\n")

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.