• Stars
    star
    157
  • Rank 238,399 (Top 5 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 8 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A decent editor written in tkinter

Porcupine

Porcupine is an editor written with the notorious Tkinter library. It supports most things you would expect from an editor, such as autocompletions and syntax highlighting.

Screenshot.

Most important features:

  • Syntax highlighting (supports many programming languages and color themes, extensible)
  • Autocompletions when pressing tab
  • Jump to definition with Ctrl+click
  • Langserver support
  • Editorconfig support
  • Git support
  • Compiling files inside the editor window
  • Running files in a separate terminal or command prompt window
  • Automatic indenting and trailing whitespace stripping when Enter is pressed
  • Indent/dedent block with Tab and Shift+Tab
  • Commenting/uncommenting multiple lines by selecting them and typing a #
  • Highlighting matching parentheses
  • Line numbers
  • Line length marker
  • Find/replace
  • Code folding
  • Multiple files can be opened at the same time like tabs in a web browser
  • The tabs can be dragged out of the window to open a new Porcupine window conveniently

Porcupine also has a very powerful plugin API, and most of the above features are implemented as plugins. This means that if you know how to use Python 3 and tkinter, you can easily customize your editor to do anything you want to. In fact, the plugin API is so powerful that if you run Porcupine without plugins, it shows up as an empty window.

Installing Porcupine

Development Install

See CONTRIBUTING.md for development instructions.

Debian-based Linux distributions (e.g. Ubuntu, Mint)

Open a terminal and run these commands:

sudo apt install python3-tk python3-pip python3-venv
sudo apt install --no-install-recommends tkdnd    # for drop_to_open plugin
python3 -m venv porcupine-venv
source porcupine-venv/bin/activate
pip install wheel
pip install https://github.com/Akuli/porcupine/archive/v2023.06.27.zip
porcu

To easily run porcupine again later, go to Settings --> Porcupine Settings and check "Show Porcupine in the desktop menu system". This makes Porcupine show up in the menu just like any other application.

You can uninstall Porcupine by unchecking "Show Porcupine in the desktop menu system" in the settings and then deleting porcupine-venv.

Other Linux distributions

Install Python 3.8 or newer with pip and tkinter somehow. If you want drag and drop support, also install tkdnd for the Tcl interpreter that tkinter uses. Then run these commands:

python3 -m venv porcupine-venv
source porcupine-venv/bin/activate
pip install wheel
pip install https://github.com/Akuli/porcupine/archive/v2023.06.27.zip
porcu

To easily run porcupine again later, go to Settings --> Porcupine Settings and check "Show Porcupine in the desktop menu system". This makes Porcupine show up in the menu just like any other application.

You can uninstall Porcupine by unchecking "Show Porcupine in the desktop menu system" in the settings and then deleting porcupine-venv.

MacOS

I don't have a Mac. If you have a Mac, you can help me a lot by installing Porcupine and letting me know how well it works.

I think you can download Python with tkinter from python.org and then run the commands for "other Linux distributions" above.

Windows

Download a Porcupine installer from the releases page and run it. Because I haven't asked Microsoft to trust Porcupine installers, you will likely get a warning similar to this one:

Windows thinks it protected your PC

You should still be able to run the installer by clicking "More info". When installed, you will find Porcupine from the start menu.

FAQ

What's new in the latest Porcupine release?

See CHANGELOG.md.

Does Porcupine support programming language X?

You will likely get syntax highlighting without any configuring and autocompletions with a few lines of configuration file editing. See the instructions on Porcupine wiki.

Help! Porcupine doesn't work.

Please install the latest version. If it still doesn't work, let me know by creating an issue on GitHub.

Is Porcupine written in Porcupine?

Yes. I wrote the very first version in nano, but Porcupine has changed a lot since.

Why is it named Porcupine?

I think because I didn't find other projects named porcupine, but I don't remember exactly. Originally, Porcupine was named "Akuli's Editor".

I want an editor that does X, but X is not in the feature list above. Does Porcupine do X?

You can run Porcupine and find out, or create an issue on GitHub and ask. If you manage to make me excited about X, I might implement it.

Why did you create a new editor?

Because I can.

Why did you create a new editor in tkinter?

Because I can.

How does feature X work?

See porcupine/X.py or porcupine/plugins/X.py.

Why not use editor X?

Because Porcupine is better.

Is Porcupine based on IDLE?

Of course not. IDLE is an awful mess that you should stay far away from.

Is Porcupine a toy project or is it meant to be a serious editor?

Porcupine is meant to be a serious editor, in fact you might regret even touching it. https://www.youtube.com/watch?v=Y3iUoFkDKjU

More Repositories

1

python-tutorial

A Python 3 programming tutorial for beginners.
Python
1,354
star
2

tkinter-tutorial

Tkinter tutorial for beginners.
Python
120
star
3

teek

Simpler alternative to tkinter.
Python
31
star
4

math-tutorial

Practical math tutorial for programmers.
Python
25
star
5

curses-minesweeper

Minesweeper game written in curses with zig
Zig
17
star
6

jou

Yet another programming language
Python
11
star
7

mantaray

An IRC client written in Python with Tkinter.
Python
11
star
8

git-guide

A practical guide to using git with github that hopefully doesn't suck.
Mako
7
star
9

classtree

A program that prints a tree of classes in a Python module.
Python
6
star
10

odotdot

Funny programming language
C
6
star
11

asda

My attempt at making a statically typed programming language
Python
5
star
12

oomph

Yet another attempt at making a usable programming language
Python
4
star
13

import-that

Bad Python practice tutorial.
4
star
14

py-tree-sitter-builds

Binary wheels for using py-tree-sitter without a C compiler
Python
4
star
15

derivater

Simple symbolic calculation library for Python
Python
3
star
16

math-derivations

Derivations and proofs of math things
Python
3
star
17

BananaGUI

Simple wrapper for popular Python GUI toolkits.
Python
3
star
18

triotk

Tiny module for using Trio with Tkinter
Python
2
star
19

stupid-c-repl

Stupid REPL for C and C++
Python
2
star
20

music-theory

A website that explains music theory using mathematics (Finnish)
Python
2
star
21

weird-language

weird programming language
Python
1
star
22

the-simple-noteprogram

Simple note-taking program written in Python 3 with GTK+ 3.
Python
1
star
23

mathpaste-gtk

Gtk program for using mathpaste
Python
1
star
24

happy-birthday

Happy birthday zaab :)
Python
1
star
25

snake

My version of the classic snake game. It's not as boring as you think it is...
Python
1
star
26

curses-klondike

Terminal klondike solitaire game
C++
1
star
27

mittari

Analog CPU and RAM usage meters for my computer
Python
1
star
28

gtk-reminder

Simple reminding program written in C using GTK+ 3.
C
1
star
29

potti

IRC bot that lets users run arbitrary Python code
Python
1
star
30

catris

The classic game of falling blocks, but with online multiplayer
Rust
1
star