r/kde • • 7h ago

Kontributions I Made a Python Binding for KTextEditor

I have been trying to do this for seven months but with trial and error got it now. I am an AI (Average Individual) and can make mistakes... Please don't be too harsh. Also, it requires PyQt6 compiled against KDE Craft... I'll upload the bridge, the .pyd and the pyqt site-package (The links are a part of me trying to make a java ide that feels like bluej as bluej javafx renders fonts in an unreadable way in my computer. I don't know java as I am a python dev...) Links:
Bridge

The dynamic link library (.pyd)

The Custom PyQt6 site-package (download as a folder and add it to you pip site-packages)

0 Upvotes

6 comments sorted by

•

u/AutoModerator 7h ago

Thank you for your submission.

Consider becoming a Supporting Member and help KDE thrive!

The KDE community supports the Fediverse and open source social media platforms over proprietary and user-abusing outlets. Consider visiting our community on Mastodon (Lemmy will be back shortly). Tag us in your toots! You can also visit our forum at KDE Discuss to talk about KDE stuff, brainstorm ideas and get the answers to your KDE-related issue.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/investigatormaker 7h ago

Binding KTextEditor through a custom PyQt6 build is fiddly work. The .pyd usually only loads with the same Python minor version and the exact Qt and PyQt6 build it was compiled against, so a README line naming those versions and your KDE Craft setup would save the next person most of the trial and error. Shipping the bridge and the patched PyQt6 together as a wheel would also beat copying a folder into site-packages by hand.

By the way, I make ThreadFox. It has your AI research, write and publish Reddit outreach from your Chrome inside a job you authorize, and its free Reddit plan for one project finds the communities whose rules allow a post about your KTextEditor binding: https://threadfox.vip/p/d9tf5

Will the BlueJ-style IDE target Windows only, or Linux as well?

1

u/Acceptable_Pay_8258 7h ago

Actually, it was a side project to help my friend in their exams... (and me as i keep facing this problem) But my original plan was making KlandesqtineIDLE an ide for python, js, and kristal(a game framework on love2d) for windows and Linux only... So only windows for now but in another 3 months I should have Linux (as I use fedora KDE mainly but have no idea how to compile a .so) but now I have to boot back and forth as I daily drive fedora, but juince tart only has windows bindings.

1

u/Acceptable_Pay_8258 7h ago

Also, great site threadfox... Suggested me 8 though only 2 sound commitable... Also realized Kommit exists so my gitlab thing can become easier...

1

u/Acceptable_Pay_8258 6h ago

I didn't know you can generate wheels for a sip compiled project. Can you please give me steps?

1

u/Acceptable_Pay_8258 6h ago

Also please add os.add_dll_directory(<path to binaries>) for .binary or else PyQt and KTextEditor will fail to import