# For plugin devs: restartKrita

**URL:** <https://krita-artists.org/t/for-plugin-devs-restartkrita/178075>\
**Category:** Plugins and Scripts\
**Tags:** plugins\
**Created:** [March 31, 2026, 6:58pm UTC](https://krita-artists.org/t/for-plugin-devs-restartkrita/178075 "2026-03-31T18:58:22Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![xanathon](https://krita-artists.org/user_avatar/krita-artists.org/xanathon/32/210242_2.png) [@xanathon](https://krita-artists.org/u/xanathon)\
**Post date:** [March 31, 2026, 6:58pm UTC](https://krita-artists.org/t/for-plugin-devs-restartkrita/178075/1 "2026-03-31T18:58:22Z")

</div>

Another - quite minimalistic - Krita plugin: **restartKrita**

This is a little special, I admit. While developing csh2krita and another addon I had to restart Krita constantly to test the new plugin versions and that got onto my nerves. So I did a quick “restart”-Plugin. You can add a UI button and restart Krita with one click (or via menu: scripts-\>restartKrita).

Tested in Krita 5.3.1 and 6.1.0 prealpha

[https:// **codeberg.org** /xanathon/restartKrita](https://codeberg.org/xanathon/restartKrita)

[#Krita](https://social.phantanews.de/tags/Krita) [#Krita5](https://social.phantanews.de/tags/Krita5) [#Krita6](https://social.phantanews.de/tags/Krita6) [#OpenSource](https://social.phantanews.de/tags/OpenSource) [#Plugin](https://social.phantanews.de/tags/Plugin) [#KritaPlugin](https://social.phantanews.de/tags/KritaPlugin) [#FOSS](https://social.phantanews.de/tags/FOSS)

---

<div class="post-metadata">

**Author:** ![f3ef](https://krita-artists.org/user_avatar/krita-artists.org/f3ef/32/211283_2.png) [@f3ef](https://krita-artists.org/u/f3ef)\
**Post date:** [April 1, 2026, 5:15am UTC](https://krita-artists.org/t/for-plugin-devs-restartkrita/178075/2 "2026-04-01T05:15:54Z")

</div>

I’d like to share one of my own approaches as well.

For example, I have a file called `Asd.py`, which contains a class:

```python
class Asd(Extension):
    actionList = []

    def testA(self):
        curAsd = self
        with open(r"G:\krita-5.2.3-prealpha-f50f6feb\resources\pykrita\asd\testA.py") as f:
            c = f.read()
            exec(c, globals(), locals())

```

And in `testA.py`, I have the following code:

```python
print('testA.py')
print(f'{curAsd}')
print(f'{Asd}')
print(f'{curAsd.actionList}')

```

Inside `testA.py`, you can access the current instance of `Asd` via `curAsd`, and things like `curAsd.actionList` work just fine.

More importantly, you can modify `testA.py` in real time without restarting Krita. Every time `testA()` is called, it reads and executes the latest content of `testA.py`. The key here is the `exec` function.

For more details and caveats about `exec`, you can refer to the official Python documentation. Of course, this approach has its limitations, but at least it provides a way to reduce the number of times we need to restart Krita during development.

The code above is extracted from part of my plugin. You can quickly create a menu entry to trigger your method using something like:

```python
window.createAction("layer2Selection", "layer2Selection", "tools/scripts").triggered.connect(self.layer2Selection)

```

Or you can create your own `QButton`—either way works. The key point here is the use of `exec`.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![Kaaivs](https://krita-artists.org/user_avatar/krita-artists.org/kaaivs/32/195687_2.png) [@Kaaivs](https://krita-artists.org/u/Kaaivs)\
**Post date:** [April 1, 2026, 7:30am UTC](https://krita-artists.org/t/for-plugin-devs-restartkrita/178075/3 "2026-04-01T07:30:54Z")

</div>

It kept showing me this.

 ![Screenshot 2026-04-01 095205](https://krita-artists.org/uploads/default/original/3X/5/9/5965affec310563ed42d4a909d9969c1f3e65bd9.png)

---

<div class="post-metadata">

**Author:** ![xanathon](https://krita-artists.org/user_avatar/krita-artists.org/xanathon/32/210242_2.png) [@xanathon](https://krita-artists.org/u/xanathon)\
**Post date:** [April 1, 2026, 10:46am UTC](https://krita-artists.org/t/for-plugin-devs-restartkrita/178075/4 "2026-04-01T10:46:04Z")

</div>

@Kaaivs i need more information. I tested this on Krita 5 and 6 on Windows, so I need to know what OS and what exakt version did you download? It may be better if you open an issue on the Codeberg download page.

**Edit:** I just tested to import the plugin again and it worked (I thought I might have botched the latest version), so I need more information to see what is wrong at your side.

---

<div class="post-metadata">

**Author:** ![xanathon](https://krita-artists.org/user_avatar/krita-artists.org/xanathon/32/210242_2.png) [@xanathon](https://krita-artists.org/u/xanathon)\
**Post date:** [April 1, 2026, 10:49am UTC](https://krita-artists.org/t/for-plugin-devs-restartkrita/178075/5 "2026-04-01T10:49:59Z")

</div>

@f3ef Great information, thanks for this.

---

<div class="post-metadata">

**Author:** ![Kaaivs](https://krita-artists.org/user_avatar/krita-artists.org/kaaivs/32/195687_2.png) [@Kaaivs](https://krita-artists.org/u/Kaaivs)\
**Post date:** [April 1, 2026, 10:56am UTC](https://krita-artists.org/t/for-plugin-devs-restartkrita/178075/6 "2026-04-01T10:56:48Z")

</div>

Krita 5.3.0 (git 148ce5c), Windows 11.

I couldn’t finish the second step after installing rust, and for that I tried to import the plugin like I usually do with the other plugin i’ve installed.

---

<div class="post-metadata">

**Author:** ![Michelist](https://krita-artists.org/user_avatar/krita-artists.org/michelist/32/65826_2.png) [@Michelist](https://krita-artists.org/u/Michelist)\
**Post date:** [April 1, 2026, 11:20am UTC](https://krita-artists.org/t/for-plugin-devs-restartkrita/178075/7 "2026-04-01T11:20:22Z")

</div>

You are mixing up things and plugins. That was the reason why I have asked you for the name of the plugin that gives you issues, which you did not even do by now!  
How should we help you when you do not cooperate and answer the most simple questions? If you have language issues, then use a translator, for Russian [DeepL.com](http://DeepL.com) and also Gemini are good options, at least far better than Google or even Yandex. For Greek, I believe [DeepL.com](http://DeepL.com) is the best, but that can be wrong.

The plugin you are talking about right now is [Zen picker](https://krita-artists.org/t/zen-picker/126951), there you need to install VS and RUST, you must compile it yourself and there are environments where it was impossible to compile a working plugin from the fragments offered by xanderjakeq, mine for instance, because no matter what I did, I was unable to get that plugin working. And I believe that I knew at least what I did there. (And I do not understand why xanderjakeq did not offer a complete build plugin, but this construction kit.)

Michelist

##################  
##################

Μπερδεύεις τα πράγματα με τα πρόσθετα. Αυτός ήταν ο λόγος για τον οποίο σου ζήτησα το όνομα του πρόσθετου που σου δημιουργεί προβλήματα, κάτι που ακόμα δεν έχεις κάνει!  
Πώς να σε βοηθήσουμε όταν δεν συνεργάζεσαι και δεν απαντάς στις πιο απλές ερωτήσεις; Αν έχεις προβλήματα με τη γλώσσα, χρησιμοποίησε έναν μεταφραστή. Για τα ρωσικά, το [DeepL.com](http://DeepL.com) και το Gemini είναι καλές επιλογές, τουλάχιστον πολύ καλύτερες από το Google ή ακόμα και το Yandex. Για τα ελληνικά, πιστεύω ότι το [DeepL.com](http://DeepL.com) είναι το καλύτερο, αλλά μπορεί να κάνω λάθος.

Το plugin για το οποίο μιλάς αυτή τη στιγμή είναι το [Zen picker](https://krita-artists.org/t/zen-picker/126951), εκεί πρέπει να εγκαταστήσεις το VS και το RUST, πρέπει να το μεταγλωττίσεις μόνος σου και υπάρχουν περιβάλλοντα όπου ήταν αδύνατο να μεταγλωττιστεί ένα λειτουργικό plugin από τα τμήματα που προσέφερε ο xanderjakeq, το δικό μου για παράδειγμα, γιατί ό,τι κι αν έκανα, δεν κατάφερα να κάνω αυτό το plugin να λειτουργήσει. Και πιστεύω ότι ήξερα τουλάχιστον τι έκανα εκεί. (Και δεν καταλαβαίνω γιατί ο xanderjakeq δεν πρόσφερε ένα πλήρες plugin, αλλά αυτό το κιτ κατασκευής.)

Michelist

_Translated with [DeepL.com](https://www.deepl.com/?utm_campaign=product&utm_source=web_translator&utm_medium=web&utm_content=copy_free_translation) (free version)_

---

<div class="post-metadata">

**Author:** ![Kaaivs](https://krita-artists.org/user_avatar/krita-artists.org/kaaivs/32/195687_2.png) [@Kaaivs](https://krita-artists.org/u/Kaaivs)\
**Post date:** [April 1, 2026, 1:57pm UTC](https://krita-artists.org/t/for-plugin-devs-restartkrita/178075/8 "2026-04-01T13:57:30Z")

</div>

It’s alright I’ll try again figuring it out.

Thank you for your time
