Allows editing files directly on python based target boards, using a terminal emulator such as MSWindows putty, Mac os terminal or Linux terminal.
The editor operates in insert mode, that is, characters typed are inserted, control+key, alt+key and ␛,key are commands.
Cursor Keys, home, end, page^ … work as you would expect.
Directory
/flash
boot.py
main.py
| Function | Keys | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Open a new file to a window | ^o | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Save | ␛ s | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Quit a window or the line edit mode. | ^q ␛ ␛ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Previous window | ^[PgUp] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Next window | ^[PgDn] ^W | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Inserting | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Characters typed are inserted | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Insert spaces to the next tab stop. ( Default tab stops are every 4 columns) Indent the selection. | [tab] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| line break at the cursor position. Auto-indent depends on setting. | [enter] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Movement go to: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Top of the file | ^t | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Left to the start of the actual or previous symbol skipping over to the previous line. | ^← | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Start-of-line OR start-of-text | [home] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Right behind the next symbol or line end, wrapping over to the next line. | ^→ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| End-of-code OR End-of-line | [end] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Line # | ^g | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Bottom of the file | ^b ^[end] previous Change | next ~[home] | ~[end] Bookmark a location in any window. | ~[ins]
| previous Bookmark | next ~[PgUp] | ~[PgDn] Match bracket the cursor is on. | Bracket pairs are ( ), [ ], { } and < > ^k | Current line or selected up / down with the cursor
| ^↑ / ^↓
| Cursor up / down a screen | | Scroll the window up / down | ^↑ / ^↓
| Selecting text
| Start selection | Once selecting is started it can be extended by moving the cursor. The selection is effected by Delete, Backspace, Copy, Cut, Paste, Tab, Backtab, Find, Save and Replace. End selecting by pressing ^L or ^space or an operation(copy, delete,...). shift → | shift ← ^L ^space Select previous / next word or extend the Selection. | ^shift ← / ^shift →
| Copy selection to the clipboard | ^c
| Cut selection to the clipboard.
The selection is cleared. | This implements the "Cut & Paste" feature. ^x
| Paste the clipboard at the cursor position. | If text is selected, it is replaced. In the line edit mode: paste the item under the cursor. ^v
| Deleting
| Selection | [del] | [backspace] Char left of the cursor. | Join to the previous line if cursor is at the beginning of the line. [backspace]
| Char under (before) the cursor. | Join with the next line if cursor is at the end of the line With auto-indent, delete the leading spaces of the line. [del]
| Word under the cursor or spaces up to the next non-space. | ^[del]
| Spaces back to the previous tab stop or non-space | [backtab]
| Line | shift[del]
| Un-indent a single line or multiple selected lines. | ^u | [backtab] Finding
| Find a regular expression. | For example ^def† finds def at the beginning of a line. Skips a selection. Case sensitivity is set by ^a. Stops at the end of file. The search string is remembered. ^f
| Next find | ^n
| Find and replace. Optionally: | yes, all, no(skip), quitWith a selection only the selection is searched and all only applies to the selection. ^r
| Additional Commands
| Redraw the screen and display file size and free space |
*main.py Row: 5/116 Col: 30. 2524KB Memory free. File 213KB, 3121KB free.
^e
| Undo the last change(s). | ^z
| Redo the operation undone by Undo
immediately after Undo(s). | Any change to the text invalidates the redo history. ^y
| Comment / Uncomment a line or selected area. | That is: insert / remove the comment character(s) (default '#') ^p | ^_ Adjust Attributes that is: those provided when pye was started. | Enter y, n, a number or several characters in comma separated fields (example:y,n,4,#,n) Empty field leaves the value unchanged.
| ||||||||||||||||||||
|
*main.py Row: 5/116 Col: 30 ^- asterisk indicates window contents have been changed. |
For online help use ^oh to open the file h in a new window and use ^w to switch between helpfile and editing window.
For quit, if the edited text was changed, confirmation is asked for.
When the last window is closed, the pye terminates providing the return value:
| Editing | Return Value |
|---|---|
| file | name of the file |
| list | list |
| directory | name of the directory |
The undo stack size per window can be set pye() default: micro 50, PC systems 500.
The PC version can be called from the command line with:
pye.py [filename , … ]
Using python3 pye.py [filename , … ] content can be redirected or pipe'd to pye.
Uses stdin/stdout on the MicroPython boards.
WiPy1: only works only on a Telnet session with the UART connection closed.
ESP8266: only the frozen bytecode variant can be used.
The size of a file that can be edited is limited by the memory of the target board.
Files up to about 13kb on ESP8266 and 68kb on PyBoard should fit.
REDRAW updates available memory show in the status line.
In addition to the file, clipboard and especially undo consume memory.
The undo stack can be limited in the call to pye using undo=n.
The clipboard size can be reduced by copying a single line into it.
When saving a file on PyBoard, the changes may not
be visible in the file system of a connected PC until you disconnect and reconnect the Pyboard drive.
See also the related discussion in the MicroPython Forum.
Saving to the internal flash file system of PyBoard is slow.
In some cases, Escape seems to lock the keyboard, it unlocks by typing any alpha character.
See Pyboard_Editor.doc in GitHub for additional details.
DGerman@Real-World-Systems.com version 1.4, 8/10/22 for pye version 2.77