https://github.com/coolcat467/idleopenline
Python IDLE extension to open a specific line in a file.
https://github.com/coolcat467/idleopenline
Last synced: about 1 year ago
JSON representation
Python IDLE extension to open a specific line in a file.
- Host: GitHub
- URL: https://github.com/coolcat467/idleopenline
- Owner: CoolCat467
- License: gpl-3.0
- Created: 2024-03-15T06:45:23.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-07T22:39:47.000Z (about 1 year ago)
- Last Synced: 2025-04-07T23:28:52.105Z (about 1 year ago)
- Language: Python
- Homepage: https://pypi.org/project/idleopenline
- Size: 44.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# IdleOpenLine
Python IDLE extension to open a specific line in a file.
[](https://github.com/CoolCat467/idleopenline/actions/workflows/tests.yml)
[](https://results.pre-commit.ci/latest/github/CoolCat467/idleopenline/main)
[](https://github.com/pre-commit/pre-commit)
[](https://github.com/psf/black)
[](https://github.com/astral-sh/ruff)
## What does this extension do?
This IDLE extension allows you to open a specific line and column from
a terminal launch command, such as `idle-python3.12 my_file.py:32:4`
and jump to line 32 column 4. This line indexing syntax is very common
in error/warning messages in many systems such as [Ruff](https://github.com/astral-sh/ruff).
There is also support for opening a selected area, such as
`idle-python3.12 my_file.py:32:4:36:9`, which would jump to 32 column 4 and
select the region starting at line 32 column 4 and ending at line 36 column 9.
Regions that are not fully defined, such as `my_file.py:32:4:36`, will not
be selected.
### Example usecase
If you happen to be using [Tilix](https://gnunn1.github.io/tilix-web/), if you go to Preferences > Advanced > Custom Links,
you could add the following:
Regex: `(?:\/*?[a-zA-Z0-9-\.\_]+\/)*[a-zA-Z0-9-\.\_]+\.(?:pyi?)(:[0-9]+)*`
Command: `idle-python3.12 $0`
This will make it so if there are filenames ending in `.py` or `.pyi` in your terminal window,
you can open them in IDLE by Ctrl + Clicking on them!
## Installation (Without root permissions)
1) Go to terminal and install with `pip install idleopenline[user]`.
2) Run command `idleuserextend; idleopenline`. You should see the following
output: `Config should be good! Config should be good!`.
3) Open IDLE, go to `Options` -> `Configure IDLE` -> `Extensions`.
If everything went well, alongside `ZzDummy` there should be and
option called `idleopenline`. This is where you can configure if
idleopenline is enabled or not.
## Installation (Legacy, needs root permission)
1) Go to terminal and install with `pip install idleopenline`.
2) Run command `idleopenline`. You will likely see a message saying
`idleopenline not in system registered extensions!`. Run the command
given to add idleopenline to your system's IDLE extension config file.
3) Again run command `idleopenline`. This time, you should see the
following output: `Config should be good!`.
4) Open IDLE, go to `Options` -> `Configure IDLE` -> `Extensions`.
If everything went well, alongside `ZzDummy` there should be and
option called `idleopenline`. This is where you can configure if
idleopenline is enabled or not.