Feeds
Real Python: Sorting Dictionaries in Python: Keys, Values, and More
You’ve got a dictionary, but you’d like to sort the key-value pairs. Perhaps you’ve tried passing a dictionary to the sorted() function but didn’t receive the results you expected. In this video course, you’ll go over everything you need to know to sort dictionaries in Python.
In this video course, you’ll:
- Review how to use the sorted() function
- Learn how to get dictionary views to iterate over
- Understand how dictionaries are cast to lists during sorting
- Learn how to specify a sort key to sort a dictionary by value, key, or nested attribute
- Review dictionary comprehensions and the dict() constructor to rebuild your dictionaries
- Consider alternative data structures for your key-value data
[ Improve Your Python With đ Python Tricks đ â Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]
Stefanie Molin: How Pre-Commit Works
Bad information drives out good or how much can we trust Wikipedia?
This post is written on behalf of the LabPlot team. It’s different compared to what we usually publish on our homepage but we feel we need to share this story with our community.
IntroductionYou might already know this, but finalizing a release for a project with the complexity and scope like that of LabPlot can be hard and exhausting. After our latest recent 2.11 release, we decided to take a short break and distance ourselves from coding and take care of other non-coding related tasks, like discussions around the NLnet grant for LabPlot, our ongoing GSoC projects, the roadmap for the next release, improving our documentation, the gallery on the homepage and the article about LabPlot on Wikipedia. Don’t worry, we’re already back to coding and working on new features for the next release
The article about LabPlot on Wikipedia (we are talking about the ‘EN’ version here, but the situation is similar for other languages) was completely outdated and still containing the information about LabPlot1 from Qt3/KDE3 times. The article became largely wrong with the introduction of LabPlot2 and with further developments in recent years. Among other things, the feature set described on Wikipedia was very far from being correct and complete in comparison to the description for other applications of its type.
The current situation was clear for us and it was also evident what needed to be done. Let’s go ahead and improve the article, we thought. Hey! Being able to contribute and to share your knowledge with everybody is the advantage of Wikipedia, right? Easier said than doneâŠ
Key TakeawaysBut before we begin:
- Wikipedia itself points out that the purpose of Wikipedia is to benefit readers by acting as a comprehensive compendium that contains information on all branches of knowledge. For this purpose, as it is clearly stated on Wikipedia, “Wikipedia has many policies or what many consider “rules”. Instead of following every rule, it is acceptable to use common sense as you go about editing. Being too wrapped up in rules can cause a loss of perspective, so there are times when it is better to ignore a rule. Even if a contribution “violates” the precise wording of a rule, it might still be a good contribution.” Link: Use common sense.
- According to Wikipedia there is no need to read any policy or guideline pages to start editing. The five pillars of Wikipedia are a popular summary of the most important principles. And the three of the pillars are formulated as follows: 1. Wikipedia is free content that anyone can use, edit, and distribute. 2. Wikipedia’s editors should treat each other with respect and civility. 3. Wikipedia has no firm rules. And If a rule prevents you from improving or maintaining Wikipedia, ignore it.
- In this Wikipedia’s article on https://en.wikipedia.org/wiki/Wikipedia:Dispute_resolution it is stated that once sustained discussion begins, productively participating in it is a priority. Editors should focus on article content during discussions; comment on content, not the contributor. And when an editor finds a passage in an article that is biased, inaccurate, or unsourced the best practice is to improve it rather than deleting salvageable text.
- I fully acknowledge these common-sense principles. I accept the fact that some phrases of the original version of the new content added by Dariusz, another core member of the LabPlot team, might have possibly infringed a less general rule on Wikipedia, and that’s why he asked for a constructive assistance, to no effect.
- I can also accept the reality and the existence of different users with the various amount of expertise, goodwill and power. The worst case are people contributing in a subversive manner over long time to such an open project to achieve more power and authority and completely different and evil goals later, and this can also be related to users with granted power. See the recent XZ Utils backdoor. I also accept the fact that the amount of work behind the scenes on Wikipedia requires the usage of automated mechanisms and bots (“Meet the ‘bots’ that edit Wikipedia”).
- However, I cannot accept the fact that the quality of knowledge on Wikipedia can be seriously undermined by power users heavily using algorithms and blindly enforcing some subjectively selected, narrow rules against the general principles outlined above, and at the same time not being open to any constructive discussion. The fact that complete content and comments are censored and removed by users with granted power or by their (semi-)automated tools, which deceives the reader and distorts the history of the discussion, is definitely not acceptable. And this is apparently not an exception, see the links here, here and here and many other similar discussions on the internet.
Keep the above in mind while you read what happened.
The incident I want to share with you is certainly not about LabPlot and its team. It’s about the negative impact of blindly invoking algorithms or quoting a single rule by Wikipedia’s users with granted power on the overall quality of the information stored on Wikipedia. As Dariusz noticed, in economics there is the observation that “bad money” drives out the “good money” from the market (Gresham’s Law “bad money drives out good”). We wonder whether the actions of the entities like MrOllie, some of which are described in the next parts of the article, are enough to justify the introduction of a new law for Wikipedia “bad information drives out good”?
Chain of eventsIn order to make the content correct and to provide an up-to-date description of the project, similar to the articles for other projects mentioned e.g. on https://en.wikipedia.org/wiki/List_of_information_graphics_software, Dariusz did multiple edits of the article over the course of two days using his Wikipedia account ‘Dlaska’. Very soon after that, the entity MrOllie became aware of his changes and reverted them completely with the suggestion that it was a promotional rewrite. Then, a “user talk” with Dariusz was initiated by MrOllie:
We are all volunteers, having no benefit other than satisfaction from developing LabPlot. But sticking to the principle of intellectual honesty, Dariusz himself fully disclosed to MrOllie that he is a LabPlot team member that felt obliged to step in to correct misleading information in the article and to make the content more complete and up-to-date, because no one has done it for a long time. Unable to get any suggestions from MrOllie despite Dariusz’ requests, Dariusz removed any phrases that could even potentially have promotional qualities (e.g. rename “strongly support” to “support”). Unfortunately, even this had no effect on the actions of MrOllie, resulting in the revert of the new content.
In parallel, I joined these activities and reverted the revert done by MrOllie and provided some explanations for this step. Another “user talk” with me (I don’t have any account, you see my IP address here) was initiated by MrOllie:
After multiple back-and-forth reverts, my IP was blocked and a “Conflict of Interest on the Noticeboard” was raised by MrOllie where he quickly got the support from his peers on Wikipedia. Dariusz’ comment didn’t change anything in the overall situation:
In parallel, more seasoned Wikipedia users jumped on the bandwagon and started ‘editing’ the article by first blindly reverting the article to the version containing potentially promotional content and then removing even more and more content and references with arguments that, in our perception, didn’t make sense arguing with anymore. Any discussion seemed completely ineffective. After most of the content had been removed from the article, to the point that the new version was more deprived of content than the old version, the user Smartse added a notability tag which was later turned into a notification box to the article stating this article “may not meet Wikipedia’s general notability guideline.”. Notability is a test used by editors to decide whether a given topic warrants its own article. So in our perception this could be interpreted as a threat of removing the article completely. The size and severity of the problem we were confronted with was already obvious at this point.
After my IP was unblocked (or maybe because I just got a new IP from my ISP), I was able to reply on this noticeboard. Since I was already foreseeing it’s going to be deleted, I took a screenshot (this is also the reason why I did screenshots for all other events):
Practically immediately my reply, red-highlighted above, was deleted without any comment or note and this is how this thread looks like afterwards:
Fortunately, Dariusz, who has an account in Wikipedia, got the notification about my added reply via email:
and after clicking within seconds on the link in the email he was informed that the comment might have been deleted, and it sure was, right after it had been added.
Immediately after this, another notification box with “A major contributor to this article appears to have a close connection with its subject.” was added to the article:
and my new IP was blocked for “abusing multiple accounts” and using them for “illegitimate reasons”:
After all these deletions, see the full history of changes
This is how the article looks like in its “final version”:
In retrospectWhat seems to have happened here looks like a well coordinated or even (semi-) automated chain of events with a pre-defined replies, arguments and actions. MrOllie stands out for the incredible diligence and regularity of his activity. The chart below shows the number of edits he has made by day of the week and hour (in local time), from 2008 to the present (source of the chart: https://xtools.wmcloud.org):
Also, over 75% of MrOllie’s edits are done in a semi-automated way with the help of tools on Wikipedia like Twinkle. So, this account functions like a programmed algorithm or somebody who is heavily relying on them.
Seeing no reasonable chance of correcting this situation in the context of being deprived of the right to effectively discuss the matters with entities like MrOllie, we gave up on our initial idea to improve the article.
What’s next?After reading more on this subject we realized that this problem is not new, but apparently it is not common knowledge either. Completely independent of who or what censored us – AI bots (is AI already winning over us?), good or bad editors etc. – trusting Wikipedia now is much harder than before. Still, the question remains about what to do next.
We can completely give up the idea of contributing to this platform and rather focus on other channels like our homepage and other online resources in the KDE and free world (Mastodon, etc) and provide more and more useful information.
Alternatively, we can ask for support from other people with more experience in editing and maybe even with more authority on Wikipedia to help us to get a reasonable description of the project on Wikipedia to the benefit of Wikipedia’s readers and LabPlot’s users.
Thoughts?
LinksFor the sake of completeness and of easier usage, here are the links mentioned in my reply that were deleted:
- https://www.reddit.com/r/WikipediaVandalism/comments/154e6zn/please_investigate_mrollie_farm/
- https://www.reddit.com/r/wikipedia/comments/hqiekq/who_is_mrollie/
- https://thomashgreco.medium.com/artificial-intelligence-bots-and-censorship-why-wikipedia-can-no-longer-be-trusted-ded395123ba9
- https://x.com/LifeBeyondD/status/1763935505987629323
Note, for the first two links above, the original posts in the Wikipedia related channels on Reddit about the same MrOllie account on Wikipedia were deleted, shame on those who think evil of this. The comments are still available, though, and the reader can get at least an idea about the original content of those posts.
I want to thank you Dariusz for his contributions to this article.
Python Bytes: #396 uv-ing your way to Python
LN Webworks: Integrating Drupal And Tailwind CSS: Step-By-Step Guide
Itâs hectic and time-consuming when it comes to making something that takes a long time. Yes, we are talking about CSS stylesheets. Itâs not easy to design a website because itâs not âeffortlessâ.Â
In this blog, we will talk about the Integration of Drupal and Tailwood CSS to make this process a little bit easier for you.Â
A brief About Tailwind CSSTailwind CSS adopts a utility-first approach rather than building a class for the component. Tailwind CSS is a utility-first approach that makes creating applications faster and easier
Tailwind CSS offers limited benefits but assures you the flexibility and power to create your unique site.Â
Specbee: How to set up Apache Solr Plugin on Ubuntu in a Lando environment and configure Search API Solr in Drupal
Talking Drupal: Talking Drupal #463 - Drupal vs DIY Site Builders
Today we are talking about DIY Site Builders, what are the benefits over Drupal (If Any), and When using Drupal makes sense with guest Ivan Stegic. Weâll also cover Drupal 11 as our module of the week.
For show notes visit: www.talkingDrupal.com/463
Topics- What is a DIY site builder
- Does TEN7 use DIY site builders
- How are DIY site builders better than Drupal
- Are they less expensive than Drupal
- HAve you ever suggested a site builder to a client
- What does a migration from a site builder look like
- Do you think starshot will make Drupal competitive with site builders
- Workspaces Extra
- Talking Drupal 451 - Just say Drupal
- Shopify
- Webflow
- Wix
- Squarespace
- Wordpress vip
- Cosmic.build
- Preshow:
Ivan Stegic - ten7.com ivanstegic
HostsNic Laflin - nLighteneddevelopment.com nicxvan John Picozzi - epam.com johnpicozzi Josh Miller - joshmiller
MOTW CorrespondentMartin Anderson-Clutz - mandclu.com mandclu
- Brief description:
- Have you been wanting a version of Drupal that can use Workspaces, Recipes, and Single Directory Components, while running all the latest versions of its underlying technologies? Drupal 11 is all of that and more
- Module name/project name:
- Brief history
- How old: created on Aug 2 by catch of Tag1 and Third & Grove
- Module features and usage
- Limited additions vs 10.3: by design to make the transition easier
- Mostly in the recipes API, e.g. new config actions
- Recap of new features vs. 10.0
- Workspaces
- Revisions and workflow are possible in the UI for Blocks and Taxonomy Terms
- UI updates for creating and reusing fields, as well as bulk content operations
- New Access Policy API and Single Directory Components
- New Navigation and Announcements Feed modules
- Contrib support out of the gate: about â
of the top 200 modules already support Drupal 11
- Adding modules that Rector estimates will only need info.yml or automated fixes brings us to over 80% of the top 200, or about 75% of all Drupal 10-compatible projects on Drupal.org
- Updated dependencies: PHP 8.3, Symfony 7, CKEditor 5 42.0,2, Twig 3.9, Yarn 4, jQuery 4.0.0-beta, jQuery UI 1.14-beta.2 and more
- Modules moved to contrib (smaller core):
- Actions UI
- Activity Tracker
- Book
- Forum
- Statistics
- Tour
- Drupal 10 will receive maintenance support until mid-2026, so the community created this release of Drupal 11 early to give sites as much time as possible to make the transition, in this case almost 2 years!
- Limited additions vs 10.3: by design to make the transition easier
Scarlett Gately Moore: KDE, Kubuntu, Debian Qt6 updates plus Kubuntu Noble .1 updates.
Another loss last week of a friend. I am staying strong and working through it. A big thank you to all of you that have donated to my car fund, I still have a long way to go. I am not above getting a cheap old car, but we live in sand dunes so it must be a cheap old car with 4Ă4 to get to my property. A vehicle is necessary as we are 50 miles away from staples such as food and water. We also have 2 funerals to attend. Please consider a donation if my work is useful to you. https://gofund.me/1e784e74 All of my work is currently unpaid work, as I am between contracts. Thank you for your consideration. Now onto the good stuff, last weeks work. It was another very busy week with Qt6 packaging in Debian/Kubuntu and KDE snaps. I also have many SRUs for Kubuntu Noble .1 release that needs their verification done.
Kubuntu:
- See Debian for the qt6 Plasma / applications work.
- Many SRUs in verification stage, please help test these: https://wiki.ubuntu.com/StableReleaseUpdates#Verification
- https://bugs.launchpad.net/ubuntu/+source/tellico/+bug/2065915 â needs testing on ARM and there are many packages in that bug.
- https://bugs.launchpad.net/ubuntu/+source/kubuntu-meta/+bug/2065465 Fix systray icons for third party apps like spotify
- https://bugs.launchpad.net/ubuntu/+source/plasma-workspace/+bug/1629543 Lightdm login manager crash when plasma selected.
- https://bugs.launchpad.net/ubuntu/+source/ark/+bug/2068491 Opening 7zip files in ark.
- https://bugs.launchpad.net/ubuntu/+source/merkuro/+bug/2063936 Merkuro fails to start. Verification done, but more testers welcome.
- https://bugs.launchpad.net/bugs/2066275 SDDM fails to boot after second boot. This SRU has been released!
- https://bugs.launchpad.net/ubuntu/+source/neochat/+bug/2061116 Neochat fails to start.
Debian:
Starting the salvage process for kdsoap which is blocking a long line of packages, notably kio-extras.
- qtmpv â in NEW
- arianna â in NEW
- xwaylandvideobridge â NEW
- futuresql â NEW
- kpat WIP â failing tests
- kdegraphics-thumbnailers (WIP)
- khelpcenter â experimental
- kde-inotify-survey â experimental
- ffmpegthumbs â experimental
- kdialog â experimental
- kwalletmanager â experimental
- libkdegames â pushed some fixes â experimental
- Tokodon â Done, but needs qtmpv to pass NEW
- Gwenview â WIP needs â kio-extras (blocked)
KDE Snaps:
Please note: Please help test the âedge snaps so I can promote them to stable.
- Arianna stable https://snapcraft.io/arianna
- Kfind stable https://snapcraft.io/kfind
- Kclock âedge https://snapcraft.io/kclock
- Kigo âedge https://snapcraft.io/kigo
- Kimagemapeditor âedge https://snapcraft.io/kimagemapeditor
- Kspacedual âedge https://snapcraft.io/kspaceduel
- Picmi âedge https://snapcraft.io/picmi
- lskat âedge https://snapcraft.io/lskat
- Ksudoku âedge https://snapcraft.io/ksudoku
- Ksquares âedge https://snapcraft.io/ksquares
- Juk âedge https://snapcraft.io/juk
- Kalgebra âedge https://snapcraft.io/kalgebra
- Ktuberling âedge https://snapcraft.io/ktuberling
- Ruqola âedge https://snapcraft.io/ruqola
WIP Snaps or MRâs made
- Kirigami-gallery ( building )
- Kiriki (building)
- Kiten (building)
- kjournald (Building)
- Kdevelop (WIP)
- Kdenlive (building)
- KHangman (WIP)
- Kubrick (WIP)
- Palapeli (Manual review in store dbus)
- Kanagram (WIP)
- Labplot (WIP)
- Kjumpingcube (MR)
- Klettres (MR)
- Kajongg âedge (Broken, problem with pyqt)
- Dragon âedge ( Broken, dbus fails)
- Ghostwriter âedge ( Broken, need to workout Qt webengine obscure way of handling hunspell dictionaries.)
- Kasts âedge ( Broken, portal failure, testing some plugs)
- Kbackup âedge ( Needs auto-connect udisks2, added home plug)
- Kdebugsettings âedge ( Added missing personal-files plug, will need approval)
- KDiamond âedge ( sound issues )
- Angelfish âedge https://snapcraft.io/angelfish ( Crashes on first run, but runs fine after that.. looking into it)
- Qrca âedge ( needs snap connect qrca:camera camera until auto-connect approved, will remain in âedge until official release)
KDE, Kubuntu, Debian Qt6 updates plus Kubuntu Noble .1 updates.
Another loss last week of a friend. I am staying strong and working through it. A big thank you to all of you that have donated to my car fund, I still have a long way to go. I am not above getting a cheap old car, but we live in sand dunes so it must be a cheap old car with 4×4 to get to my property. A vehicle is necessary as we are 50 miles away from staples such as food and water. We also have 2 funerals to attend. Please consider a donation if my work is useful to you. https://gofund.me/1e784e74 All of my work is currently unpaid work, as I am between contracts. Thank you for your consideration. Now onto the good stuff, last weeks work. It was another very busy week with Qt6 packaging in Debian/Kubuntu and KDE snaps. I also have many SRUs for Kubuntu Noble .1 release that needs their verification done.
Kubuntu:
- See Debian for the qt6 Plasma / applications work.
- Many SRUs in verification stage, please help test these: https://wiki.ubuntu.com/StableReleaseUpdates#Verification
- https://bugs.launchpad.net/ubuntu/+source/tellico/+bug/2065915 – needs testing on ARM and there are many packages in that bug.
- https://bugs.launchpad.net/ubuntu/+source/kubuntu-meta/+bug/2065465 Fix systray icons for third party apps like spotify
- https://bugs.launchpad.net/ubuntu/+source/plasma-workspace/+bug/1629543 Lightdm login manager crash when plasma selected.
- https://bugs.launchpad.net/ubuntu/+source/ark/+bug/2068491 Opening 7zip files in ark.
- https://bugs.launchpad.net/ubuntu/+source/merkuro/+bug/2063936 Merkuro fails to start. Verification done, but more testers welcome.
- https://bugs.launchpad.net/bugs/2066275 SDDM fails to boot after second boot. This SRU has been released!
- https://bugs.launchpad.net/ubuntu/+source/neochat/+bug/2061116 Neochat fails to start.
Debian:
Starting the salvage process for kdsoap which is blocking a long line of packages, notably kio-extras.
- qtmpv â in NEW
- arianna â in NEW
- xwaylandvideobridge â NEW
- futuresql â NEW
- kpat WIP – failing tests
- kdegraphics-thumbnailers (WIP)
- khelpcenter – experimental
- kde-inotify-survey – experimental
- ffmpegthumbs – experimental
- kdialog – experimental
- kwalletmanager – experimental
- libkdegames – pushed some fixes – experimental
- Tokodon â Done, but needs qtmpv to pass NEW
- Gwenview â WIP needs – kio-extras (blocked)
KDE Snaps:
Please note: Please help test the âedge snaps so I can promote them to stable.
- Arianna stable https://snapcraft.io/arianna
- Kfind stable https://snapcraft.io/kfind
- Kclock âedge https://snapcraft.io/kclock
- Kigo âedge https://snapcraft.io/kigo
- Kimagemapeditor âedge https://snapcraft.io/kimagemapeditor
- Kspacedual âedge https://snapcraft.io/kspaceduel
- Picmi –edge https://snapcraft.io/picmi
- lskat –edge https://snapcraft.io/lskat
- Ksudoku –edge https://snapcraft.io/ksudoku
- Ksquares –edge https://snapcraft.io/ksquares
- Juk –edge https://snapcraft.io/juk
- Kalgebra –edge https://snapcraft.io/kalgebra
- Ktuberling –edge https://snapcraft.io/ktuberling
- Ruqola –edge https://snapcraft.io/ruqola
WIP Snaps or MRâs made
- Kirigami-gallery ( building )
- Kiriki (building)
- Kiten (building)
- kjournald (Building)
- Kdevelop (WIP)
- Kdenlive (building)
- KHangman (WIP)
- Kubrick (WIP)
- Palapeli (Manual review in store dbus)
- Kanagram (WIP)
- Labplot (WIP)
- Kjumpingcube (MR)
- Klettres (MR)
- Kajongg –edge (Broken, problem with pyqt)
- Dragon âedge ( Broken, dbus fails)
- Ghostwriter âedge ( Broken, need to workout Qt webengine obscure way of handling hunspell dictionaries.)
- Kasts âedge ( Broken, portal failure, testing some plugs)
- Kbackup âedge ( Needs auto-connect udisks2, added home plug)
- Kdebugsettings âedge ( Added missing personal-files plug, will need approval)
- KDiamond âedge ( sound issues )
- Angelfish âedge https://snapcraft.io/angelfish ( Crashes on first run, but runs fine after that.. looking into it)
- Qrca âedge ( needs snap connect qrca:camera camera until auto-connect approved, will remain in âedge until official release)
FSF Events: Free Software Directory meeting on IRC: Friday, August 16, starting at 12:00 EDT (16:00 UTC)
PyCharm: PyCharm 2024.2 Is Here: Improvements for Jupyter Notebooks, Databricks Integration, New AI Assistant Features, and More!
Offering a wide range of new and improved functionality, including Hugging Face integration, new AI Assistant features, a new default UI, and an overall better user experience, PyCharm 2024.2 is a must for anyone looking to increase their productivity.
Learn about all the updates on our Whatâs New page, download the latest version from our website, or update your current version through our free Toolbox App.
Download PyCharm 2024.2 PyCharm 2024.2 key features Databricks integration PROPyCharm now provides direct integration with Databricks via a plugin. You can connect to a Databricks cluster, execute scripts and notebooks as workflows, execute files directly in a Spark shell on a cluster, and monitor the progress â all from the comfort of your IDE.
This integration allows you to harness the power of your IDE when working with Databricks, making the process faster and easier.
Hugging Face integration PROPyCharm 2024.2 can now suggest the most relevant Hugging Face models based on your use case. When you select a model, the IDE will suggest inserting a code snippet that allows you to use it directly in the open file, and PyCharm will download and install any missing dependencies automatically.
You can also identify unused models installed on your machine and delete them to free up disk space directly from the IDE.
Additionally, you can inspect your Hugging Face Datasets library data as an interactive dataframe, utilizing features like the chart view, pagination, and the ability to sort and export tables.
Read more Jupyter notebooks PROInstantly preview the value of a chosen variable simply by hovering over the variableâs line. You no longer need to use the debugger or print statements!
Furthermore, you can now expand and collapse cells, as well as run them straight from the gutter. Additionally, cells now display their statuses and assigned tags.
All these improvements are designed to make working with Jupyter notebooks in PyCharm seamless, fast, and efficient.
AI cells in Jupyter notebooksWith our new AI cell option, you can add prompts directly inside your notebooks and work with AI Assistant right from there. A light bulb icon next to the AI cell provides suggestions about the next steps in your data analysis workflow.
One-click dataframe visualizationVisualize your dataframes with the help of AI Assistant, which now provides suggestions about the graphs and plots most suitable to your context.
AI AssistantJetBrains AI Assistant 2024.2 enhances cloud-based code completion with faster, more accurate suggestions and a better UX, including syntax highlighting and the option to accept suggestions incrementally. The AI chat now uses the latest GPT-4o model and supports chat references and semantic search.
New features include AI integration in the Terminal tool window for command generation, AI-assisted VCS conflict resolution, and customizable prompts for documentation and unit test creation.
Learn about these and other AI Assistant enhancements in this dedicated blog post.
Database tools PRO New AI Assistant featuresWith the text-to-SQL feature, you can generate SQL code directly in the editor by clicking Generate Code with AI and entering your prompt. You can accept, regenerate, or refine the code, and take it to the AI chat if you have further questions.
Additionally, AI Assistant can help with modifying tables, allowing you to request changes like switching all VARCHAR data types to CHAR.
It can also help you understand and fix SQL problems, suggesting explanations and fixes.
Read more User experience Preview option in Search EverywhereThe Search Everywhere dialog now includes an option to preview the codebase elements youâre searching for, offering additional context and making it easier to navigate through your project.
Improved full line code completion PROIn 2024.2, full line code completion suggestions now include code highlighting, and new shortcuts allow you to accept individual words or entire lines from longer suggestions. Weâve also refined how accepted changes are integrated into your code, eliminating any formatting issues.
Run/Debug String variable visualizers for JSON, XML, and other formatsDebugging and browsing long string variables with complex data formats is now much easier. The updated debugger offers properly formatted visualizations for string variables with strings encoded in JSON, XML, HTML, JWT, and URL.
Frameworks and technologies PRO GraalJS as the execution engine for the HTTP ClientWeâve upgraded the JavaScript execution engine used in the HTTP Client to GraalJS. This allows you to use all GraalJS features, including full support for the ECMAScript 2023 specification, when testing endpoints with PyCharmâs HTTP Client and using JavaScript in .http files to handle the results.
HTTP Client improvementsIn the HTTP Client, weâve added XPath functionality for querying and manipulating XML and HTML documents, support for iterating through collections using JSONPath to automate requests, and the ability to create and add custom API methods effortlessly.
Enhanced Terraform supportWe’ve enhanced PyCharm’s Terraform support with full line code completion, improved context-aware code completion, refined syntax highlighting, and better error detection with quick-fix suggestions. Additionally, a quick documentation feature now provides instant tooltips, offering immediate information to streamline your Terraform workflow.
Frontend PRO Improved support for major web frameworksPyCharm can now resolve paths for frameworks that use file-system-based routing. It can also resolve link paths based on your project’s file system, providing autocompletion and navigation for Next.js, Nuxt, SvelteKit, and Astro. There is also support for new Svelte 5 snippets and render tags.
Additionally, weâve implemented language server protocol (LSP) support for Astro and upgraded the Vue LSP to Vue Language Service v2, improving code completion and the overall developer experience.
Ability to run and debug TypeScript files directlyYou can now run and debug TypeScript files from different entry points, including the file context menu, the Run widget, and the Current File configuration.
Remote development PRO Reverse port forwardingWith reverse port forwarding, you can now connect a remote IDE to ports available on the client machine. This is particularly useful for mobile development and connecting to local databases.
Download PyCharm 2024.2These are all the key features of this release, but thereâs much more to explore! Visit our Whatâs New page or release notes for the full breakdown and additional details about the features mentioned here.
If you encounter any problems, please report them in our issue tracker so we can address them promptly.
Connect with us on X (formerly Twitter) to share your thoughts on PyCharm 2024.2. Weâre looking forward to hearing them!
Real Python: Python News Roundup: August 2024
In July, there was some exciting news for the Python community as the Python core development team released versions 3.13.0b4 and 3.13.0rc1 of the language. The 3.13.0b4 release marked the end of the beta phase and paved the way for the release candidate phase.
Note that 3.13.0rc1 is a pre-release, so you shouldnât use it for production environments. However, it provides a great way to try some new and exciting language features.
Thereâs also great some news from the Python Software Foundation, PyOhio 2024, and the Python ecosystem.
Letâs dive into the most exciting Python news from last month!
Python 3.13.0b4 and 3.13.0rc1Python 3.13 has reached its fourth beta release, marking the end of the beta phase. Beta releases serve to test new features and bug fixes. However, itâs important to note that this is a preview release and it isnât recommended for use in production environments.
If youâre a library maintainer, youâre encouraged to test your code with this new version so you can prepare it to support the latest features of the language.
Note: To learn more about pre-releases, check out the How Can You Install a Pre-Release Version of Python? tutorial.
One of the most significant new features of Python 3.13 is the improved interactive interpreter or REPL, which now provides several cool features, including:
- Colorized prompts
- Multiline editing with history preservation
- Interactive help browsing with F1 and a separate command history
- History browsing with F2
- Paste mode for larger blocks of code with F3
- REPL-specific commands like help, exit, and quit without the call parentheses
This is exciting news! The standard REPL up until Python 3.13 was lacking, and sometimes it was necessary to install a third-party tool like bpython or IPython to compensate.
Again, with this release, the beta phase has officially ended, and the first release candidateâ3.13.0rc1âis considered the penultimate release preview. In this release candidate phase, only bug fixes are allowed.
The second candidate, which is the last planned release preview, should be out on September 3, 2024, and the official release of 3.13 should be ready on October 1, 2024. Only more excitement lies ahead!
The Python Software Foundation (PSF) Shares Great News Read the full article at https://realpython.com/python-news-august-2024/ »[ Improve Your Python With đ Python Tricks đ â Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]
Week 11 recap - Final Stretch
The Drop Times: Drupal GovCon 2024: The Heartbeat of the DC Drupal community
Mike Driscoll: Creating Progress Bars in Your Terminal with Python and Textual
The Textual package is a great way to create GUI-like applications with Python in your terminal. These are known as text-based user interfaces or TUIs. Textual has many different widgets built-in to the framework.
One of those widgets is the ProgressBar. If you need to show the progress of a download or long-running process, then you will probably want to use a progress bar or some kind of spinner widget to show the user that your application is working.
This tutorial will show you how to create a simple progress bar with Textual!
InstallationIf you do not have Textual installed yet, you can get it by using Python’s handy pip tool. Open up your terminal and run the following command there:
python -m pip install textualTextual will get installed, along with all its dependencies. You may want to create a virtual environment first and install Textual there.
Creating a ProgressBar in TextualCreating a progress bar with Textual is pretty straightforward. The following code is based on an example from the Textual documentation. The main difference is that this version uses a button to start the timer, simulating a download or some other long-running process rather than catching a key event.
You can copy this code into your favorite Python editor and give it a quick study:
# progressbar_demo.py from textual.app import App, ComposeResult from textual.containers import Center, Middle from textual.timer import Timer from textual.widgets import Button, ProgressBar class Progress(App[None]): timer = Timer def compose(self) -> ComposeResult: with Center(): with Middle(): yield ProgressBar() yield Button("Start") def on_mount(self) -> None: """ Set up the timer to simulate progress """ self.timer = self.set_interval(1 / 10, self.advance_progressbar, pause=True) def advance_progressbar(self) -> None: """ Called to advance the progress bar """ self.query_one(ProgressBar).advance(1) def on_button_pressed(self) -> None: """ Event handler that is called when button is pressed """ self.query_one(ProgressBar).update(total=100) self.timer.resume() if __name__ == "__main__": app = Progress() app.run()The compose() method is kind of fun as it uses both the Center() and the Middle() containers to position the widgets in the middle of the terminal. You then set up the timer object in on_mount() and you start the timer in on_button_pressed()which is the Button widget’s event handler.
When you run this code, you will initially see what’s known as an indeterminate progress bar. What that means is that Textual doesn’t have any information about how long the progress is, so the progress bar just shows a kind of “bouncing” or “cycling” progress:
When you press the “Start” button, you will see the progress bar go from 0-100%, and the text fields to the right will update as well:
If you want to make your progress bar stand out, add a gradient. A gradient will make the colors of the progress bar change over time and make the widget look neat!
Wrapping UpAdding a progress bar or simply showing some kind of informational widget that lets the user know your application is working is always a good idea. You don’t want the user to think the application has crashed or frozen. The user might be forced to close the application and lose their information after all!
Fortunately, Textual makes adding a progress bar easy. Not only is it easy, but the progress bar is easy to update so you can accurately give the user a sense of when the work will be done. Give it a try and see what you think!
Related ReadingWant to learn more about Textual? Check out the following articles:
The post Creating Progress Bars in Your Terminal with Python and Textual appeared first on Mouse Vs Python.
The Drop Times: Latest Breakthroughs in the Drupal Starshot Initiative
Zato Blog: How to correctly integrate APIs in Python
Understanding how to effectively integrate various systems and APIs is crucial. Yet, without a dedicated integration platform, the result will be brittle point-to-point, spaghetti integrations, that never lead to good outcomes.
†Read this article about Zato, an open-source integration platform in Python, for an overview of what to avoid and how to do it correctly instead.
More blog postsâ€Golems GABB: Scaling and Performance Optimization of Drupal
The future is not distant anymore, so what kind of "good Drupal performance and scalability" can we expect in 2024? Moreover, what implementations can be done via Drupal's features and options to impress an online audience?
Nowadays, in the era of digital content, a website should be ultramodern in both presentation and performance. Consumers prefer easy experiences. Hence, the ability of an organization to do this for them is a critical factor in service delivery. Regarding the user side of the services, sites should hold up with rapid traffic growth, constantly upgrade, and provide users with a wide range of features.
Moreover, such a growing level of cross-communication may not only meet those expectations but also go far beyond them to help organizations grow in the digital domain.Â
Freexian Collaborators: Monthly report about Debian Long Term Support, July 2024 (by Roberto C. SĂĄnchez)
Like each month, have a look at the work funded by Freexianâs Debian LTS offering.
Debian LTS contributorsIn July, 13 contributors have been paid to work on Debian LTS, their reports are available:
- Bastien RoucariĂšs did 20.0h (out of 20.0h assigned).
- Chris Lamb did 18.0h (out of 18.0h assigned).
- Daniel Leidert did 5.0h (out of 4.0h assigned and 6.0h from previous period), thus carrying over 5.0h to the next month.
- Guilhem Moulin did 8.75h (out of 4.5h assigned and 15.5h from previous period), thus carrying over 11.25h to the next month.
- Lee Garrett did 51.5h (out of 10.5h assigned and 43.0h from previous period), thus carrying over 2.0h to the next month.
- Lucas Kanashiro did 5.0h (out of 5.0h assigned and 15.0h from previous period), thus carrying over 15.0h to the next month.
- Markus Koschany did 40.0h (out of 40.0h assigned).
- Ola Lundqvist did 4.0h (out of 10.0h assigned and 14.0h from previous period), thus carrying over 20.0h to the next month.
- Roberto C. SĂĄnchez did 5.0h (out of 5.25h assigned and 6.75h from previous period), thus carrying over 7.0h to the next month.
- Santiago Ruano RincĂłn did 6.0h (out of 16.0h assigned), thus carrying over 10.0h to the next month.
- Sean Whitton did 2.25h (out of 6.0h assigned), thus carrying over 3.75h to the next month.
- Sylvain Beucler did 39.5h (out of 2.5h assigned and 51.0h from previous period), thus carrying over 14.0h to the next month.
- Thorsten Alteholz did 11.0h (out of 11.0h assigned).
In July, we have released 1 DLA.
August will be the month that Debian 11 makes the transition to LTS. Our contributors have already been hard at work with preparatorty tasks and also with making contributions to packages in Debian 11 in close collaboration with the Debian security team and package maintainers. As a result, users and sponsors should not observe any especially notable differences as the transition occurs.
While only one DLA was released in July (as a result of the transitional state of Debian 11 âbullseyeâ), there were some notable highlights. LTS contributor Guilhem Moulin prepared an update of libvirt for Debian 11 (in collaboration with the Old-Stable Release Managers and the Debian Security Team) to fix a number of outstanding CVEs which did not rise to the level of a DSA by the Debian Security Team. The update prepared by Guilhem will be included in Debian 11 as part of the final point release at the end of August, one of the final transition steps by the Release Managers as Debian 11 moves entirely to the LTS Teamâs responsibility. Notable work was also undertaken by contributors Lee Garrett (fixes on the ansible test suite and a bullseye update), Lucas Kanashiro (Rust toolchain, utilized by the clamav, firefox-esr, and thunderbird packages), and Sylvain Beucler (fixes on the ruby2.5/2.7 test suites and CI infrastructure), which will help improve the quality of updates produced during the next LTS cycle.
June was the final month of LTS for Debian 10 (as announced on the debian-lts-announce mailing list). No additional Debian 10 security updates will be made available on security.debian.org.
However, Freexian and its team of paid Debian contributors will continue to maintain Debian 10 going forward for customers of the Extended LTS offer. Subscribe right away if you sill have Debian 10 systems which must be kept secure (and which cannot yet be upgraded).
Thanks to our sponsorsSponsors that joined recently are in bold.
- Platinum sponsors:
- TOSHIBA (for 106 months)
- Civil Infrastructure Platform (CIP) (for 74 months)
- VyOS Inc (for 38 months)
- Gold sponsors:
- Roche Diagnostics International AG (for 116 months)
- Linode (for 110 months)
- Babiel GmbH (for 100 months)
- PlatâHome (for 99 months)
- CINECA (for 74 months)
- University of Oxford (for 56 months)
- Deveryware (for 43 months)
- EDF SA (for 28 months)
- Dataport AöR (for 3 months)
- Silver sponsors:
- Domeneshop AS (for 121 months)
- Nantes MĂ©tropole (for 115 months)
- Univention GmbH (for 107 months)
- Université Jean Monnet de St Etienne (for 107 months)
- Ribbon Communications, Inc. (for 101 months)
- Exonet B.V. (for 91 months)
- Leibniz Rechenzentrum (for 85 months)
- MinistĂšre de lâEurope et des Affaires ĂtrangĂšres (for 69 months)
- Cloudways by DigitalOcean (for 58 months)
- Dinahosting SL (for 56 months)
- Bauer Xcel Media Deutschland KG (for 50 months)
- Platform.sh SAS (for 50 months)
- Moxa Inc. (for 44 months)
- sipgate GmbH (for 42 months)
- OVH US LLC (for 40 months)
- Tilburg University (for 40 months)
- GSI Helmholtzzentrum fĂŒr Schwerionenforschung GmbH (for 31 months)
- Soliton Systems K.K. (for 28 months)
- THINline s.r.o. (for 4 months)
- Bronze sponsors:
- Evolix (for 121 months)
- Seznam.cz, a.s. (for 121 months)
- Intevation GmbH (for 118 months)
- Linuxhotel GmbH (for 118 months)
- Daevel SARL (for 117 months)
- Bitfolk LTD (for 116 months)
- Megaspace Internet Services GmbH (for 116 months)
- Greenbone AG (for 115 months)
- NUMLOG (for 115 months)
- WinGo AG (for 114 months)
- Entrâouvert (for 105 months)
- Adfinis AG (for 103 months)
- Tesorion (for 98 months)
- GNI MEDIA (for 97 months)
- Laboratoire LEGI - UMR 5519 / CNRS (for 97 months)
- Bearstech (for 89 months)
- LiHAS (for 89 months)
- Catalyst IT Ltd (for 84 months)
- Supagro (for 79 months)
- Demarcq SAS (for 78 months)
- Université Grenoble Alpes (for 64 months)
- TouchWeb SAS (for 56 months)
- SPiN AG (for 53 months)
- CoreFiling (for 49 months)
- Institut des sciences cognitives Marc Jeannerod (for 44 months)
- Observatoire des Sciences de lâUnivers de Grenoble (for 40 months)
- Tem Innovations GmbH (for 35 months)
- WordFinder.pro (for 34 months)
- CNRS DT INSU RĂ©sif (for 33 months)
- Alter Way (for 26 months)
- Institut Camille Jordan (for 16 months)
- SOBIS Software GmbH
Freexian Collaborators: Debian Contributions: autopkgtest/incus builds, live-patching, Salsa CI, Python 3.13 (by Stefano Rivera)
Contributing to Debian is part of Freexianâs mission. This article covers the latest achievements of Freexian and their collaborators. All of this is made possible by organizations subscribing to our Long Term Support contracts and consulting services.
autopkgtest/Incus build streamlining, by Colin WatsonColin contributed a change to allow maintaining Incus container and VM images in parallel. Both of these are useful (containers are faster, but some tests need full machine isolation), and the build tools previously didnât handle that very well.
This isnât yet in unstable, but once it is, keeping both flavours of unstable images up to date will be a simple matter of running this regularly:
RELEASE=sid autopkgtest-build-incus images:debian/trixie RELEASE=sid autopkgtest-build-incus --vm images:debian/trixie Linux live-patching, by Santiago Ruano RincĂłnIn collaboration with Emmanuel Arias, Santiago continued the work on the support for applying security fixes to the Linux kernel in Debian, without the need to reboot the machine. As mentioned in the previous month report, kpatch 0.9.9-1 (and 0.9.9-2 afterwards) was uploaded to unstable in July, closing the Intent to Salvage (ITS) bug. With this upload, the remaining RC bugs were solved, and kpatch was able to transition to Debian testing recently. Kpatch is expected to be an important component in the live-patching support, since it makes it easy to build a patch as a kernel module. Emmanuel and Santiago continued to work on the design for Linux live-patching and presented the current status in the DebConf24 presentation.
Salsa CI, by Santiago Ruano RincĂłnTo be able to add RISC-V support and to avoid using tools not packaged in Debian (See #331), the Salsa CI pipeline first needed to move away from kaniko to build the images used by the pipeline. Santiago created a merge request to use buildah instead, and it was merged last month. Santiago also prepared a couple of more MRs related to how the images are built: initial RISC-V support, that should be merged after improving how built images are tested. The switch to buildah introduced a regression in the work-in-progress MR that adds new build image so the build job can run sbuild. Santiago hopes to address this regression and continue with the sbuild-related MRs in August.
Additionally, Santiago also contributed to the install docker-cli instead of docker.io in the piuparts image MR, and reviewed others such as reprotest: Add âappend-build-command option, fix failure at manual pipeline run when leaving RELEASE variable empty and Fix image not found error on image building stage.
Python 3.13 Betas, by Stefano RiveraAs Python 3.13 is approaching the first release, Stefano has been uploading the beta releases to Debian unstable. Most of these have uncovered small bugs that needed to be investigated and fixed.
Stefano also took the time to review the current patch set against cPython in Debian.
Python 3.13 isnât marked as a supported Python release in Debianâs Python tooling, yet, so nothing has been built against it, yet. Now that the Python 3.12 transition has completed, the next task will be to start trying to build Debianâs Python module packages against Python 3.13, to estimate the work required to transition to 3.13 in unstable.
Miscellaneous contributions- Carles Pina updated the packages python-asyncclick, python-pyaarlo and prepared updates for python-ring-doorbell and simplemonitor.
- Carles Pina updated (reviewing or translating) Catalan translations for adduser, apt-listchanges, debconf and shadow.
- Colin merged OpenSSH 9.8, and prepared a corresponding release note for DSA support now being disabled. This version included some substantial changes to split the server into a listener binary and a per-session binary, and those required some corresponding changes in the GSS-API key exchange patch. Sorting out the details of this and getting it to work again took some time.
- Colin upgraded 11 Python packages to new upstream versions, and modernized the build process and/or added non-superficial autopkgtests to several more.
- RaphaĂ«l Hertzog tweaked tracker.debian.orgâs debci task to work around changes in the JSON output. He also improved tracker.debian.orgâs ability to detect bounces due to spam to avoid unsubscribing emails that are not broken, but that are better than Debian at rejecting spam.
- Helmut Grohne monitored the /usr-move transition with few incidents. A notable one is that some systems have ended up with aliasing links that donât match the ones installed by base-files which could lead to an unpack error from dpkg. This is now prevented by having base-files.preinst error out.
- Helmut investigated toolchain bootstrap failures with gcc-14 in rebootstrap but would only discover the cause in August.
- Helmut sent a MR for the cross-exe-wrapper requested by Simon McVittie for gobject-introspection. It is a way of conditionally requesting qemu-user when emulation is required for execution during cross compilation.
- Helmut sent three patches for cross build failures.
- Thorsten Alteholz uploaded packages lprint and magicfilter to fix RC-bugs that appeared due to the introduction of gcc-14.
- Santiago continued to work on activities related to the DebConf24 Content Team, including reviewing the schedule and handling updates on it.
- Santiago worked on preparations for the DebConf25, to be held in Brest, France, next year. A video of the BoF presented during DebConf24 can be found here.
- Stefano worked on preparations for DebConf24, and helped to run the event.