Python https://opensource.com/tags/python en Using mocks in Python https://opensource.com/article/23/4/using-mocks-python <span class="field field--name-title field--type-string field--label-hidden">Using mocks in Python</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/users/moshez" class="username">Moshe Zadka</a></span> <span class="field field--name-created field--type-created field--label-hidden">Sat, 04/01/2023 - 03:00</span> <div class="clearfix text-formatted field field--name-field-article-subhead field--type-text-long field--label-hidden field__item"><p>Test your code safely with mocks.</p> </div> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>April 1st is all about fake stories and pretending. This makes it the perfect day to talk about mocking. Sometimes, using real objects is hard, ill-advised, or complicated…</p> </div> <div class="field field--name-field-lead-image field--type-entity-reference field--label-hidden field__item"> <a href="/article/23/4/using-mocks-python" hreflang="en"><img src="/sites/default/files/styles/article_teaser/public/lead-images/OSDC_women_computing_4.png?itok=sZ3ohT_Q" width="360" height="202" alt="Woman sitting in front of her laptop" title="Women in tech and computing" loading="lazy" class="image-style-article-teaser" /> </a> </div> Sat, 01 Apr 2023 07:00:00 +0000 Moshe Zadka 70562 at https://opensource.com Why you should use Python and Rust together https://opensource.com/article/23/3/python-loves-rust <span class="field field--name-title field--type-string field--label-hidden">Why you should use Python and Rust together</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/users/moshez" class="username">Moshe Zadka</a></span> <span class="field field--name-created field--type-created field--label-hidden">Tue, 03/28/2023 - 03:00</span> <div class="clearfix text-formatted field field--name-field-article-subhead field--type-text-long field--label-hidden field__item"><p>Rust and Python have complementary strengths and weaknesses. Prototype in Python and move performance bottlenecks to Rust.</p> </div> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Python and Rust are very different languages, but they actually go together rather well. But before discussing how to combine Python with Rust, I want to introduce Rust itself…</p> </div> <div class="field field--name-field-lead-image field--type-entity-reference field--label-hidden field__item"> <a href="/article/23/3/python-loves-rust" hreflang="en"><img src="/sites/default/files/styles/article_teaser/public/lead-images/rust_programming_crab_sea.png?itok=5rD1U9f1" width="360" height="202" alt="Ferris the crab under the sea, unofficial logo for Rust programming language" title="Ferris the crab under the sea, unofficial logo for Rust programming language" loading="lazy" class="image-style-article-teaser" /> </a> </div> Tue, 28 Mar 2023 07:00:00 +0000 Moshe Zadka 70525 at https://opensource.com Create a ChatBot in Mattermost with Python https://opensource.com/article/23/3/chatbot-mattermost-python <span class="field field--name-title field--type-string field--label-hidden">Create a ChatBot in Mattermost with Python</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/users/drmjg" class="username">DrMJG</a></span> <span class="field field--name-created field--type-created field--label-hidden">Mon, 03/27/2023 - 03:00</span> <div class="clearfix text-formatted field field--name-field-article-subhead field--type-text-long field--label-hidden field__item"><p>Implement ChatOps in your organization with a simple open source bot.</p> </div> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>ChatOps is a collaboration model that connects people, processes, tools, and automation into a transparent workflow. Mattermost is an open source, self-hosted messaging…</p> </div> <div class="field field--name-field-lead-image field--type-entity-reference field--label-hidden field__item"> <a href="/article/23/3/chatbot-mattermost-python" hreflang="en"><img src="/sites/default/files/styles/article_teaser/public/lead-images/talk_chat_communication_team.png?itok=U0FZ-naW" width="360" height="202" alt="Chat bubbles" title="Chat bubbles" loading="lazy" class="image-style-article-teaser" /> </a> </div> Mon, 27 Mar 2023 07:00:00 +0000 DrMJG 70508 at https://opensource.com Create a modern user interface with the Tkinter Python library https://opensource.com/article/23/2/user-interface-tkinter-python <span class="field field--name-title field--type-string field--label-hidden">Create a modern user interface with the Tkinter Python library</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/users/patrik-dufresne" class="username">patrik-dufresne</a></span> <span class="field field--name-created field--type-created field--label-hidden">Tue, 02/14/2023 - 03:00</span> <div class="clearfix text-formatted field field--name-field-article-subhead field--type-text-long field--label-hidden field__item"><p>TKVue saves time while developing the graphical interface and makes it easier to maintain and modify the code afterward.</p> </div> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Python's Tkinter library isn't exactly known for its good looks. I've developed a library to help create a modern graphical user interface for Python. I spent a lot of time…</p> </div> <div class="field field--name-field-lead-image field--type-entity-reference field--label-hidden field__item"> <a href="/article/23/2/user-interface-tkinter-python" hreflang="en"><img src="/sites/default/files/styles/article_teaser/public/lead-images/computer_browser_web_desktop.png?itok=FHxRMSe1" width="360" height="202" alt="Digital images of a computer desktop" title="Digital images of a computer desktop" loading="lazy" class="image-style-article-teaser" /> </a> </div> Tue, 14 Feb 2023 08:00:00 +0000 patrik-dufresne 70452 at https://opensource.com Automate Mastodon interactions with Python https://opensource.com/article/23/1/mastodon-api-python <span class="field field--name-title field--type-string field--label-hidden">Automate Mastodon interactions with Python</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/users/moshez" class="username">Moshe Zadka</a></span> <span class="field field--name-created field--type-created field--label-hidden">Tue, 01/31/2023 - 03:00</span> <div class="clearfix text-formatted field field--name-field-article-subhead field--type-text-long field--label-hidden field__item"><p>Follow along as I play with the Mastodon API to create a new application.</p> </div> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>The federated Mastodon social network has gotten very popular lately. It's fun to post on social media, but it's also fun to automate your interactions. There is some…</p> </div> <div class="field field--name-field-lead-image field--type-entity-reference field--label-hidden field__item"> <a href="/article/23/1/mastodon-api-python" hreflang="en"><img src="/sites/default/files/styles/article_teaser/public/lead-images/OSDC_women_computing_5.png?itok=0PjhrDTT" width="360" height="202" alt="Women in computing and open source v5" title="Women in computing and open source v5" loading="lazy" class="image-style-article-teaser" /> </a> </div> Tue, 31 Jan 2023 08:00:00 +0000 Moshe Zadka 70423 at https://opensource.com Packaging Python modules with wheels https://opensource.com/article/23/1/packaging-python-modules-wheels <span class="field field--name-title field--type-string field--label-hidden">Packaging Python modules with wheels</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/users/hansic99" class="username">hANSIc99</a></span> <span class="field field--name-created field--type-created field--label-hidden">Fri, 01/27/2023 - 03:00</span> <div class="clearfix text-formatted field field--name-field-article-subhead field--type-text-long field--label-hidden field__item"><p>By using a CI/CD build system, providing Python packages in the advantageous wheel format becomes a breeze.</p> </div> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Everyone who has been working with Python for a while might already have come around packages. In Python terminology, packages (or distribution packages) are collections of…</p> </div> <div class="field field--name-field-lead-image field--type-entity-reference field--label-hidden field__item"> <a href="/article/23/1/packaging-python-modules-wheels" hreflang="en"><img src="/sites/default/files/styles/article_teaser/public/lead-images/python-programming-code-keyboard.png?itok=4gsBVekG" width="360" height="202" alt="Hands on a keyboard with a Python book " title="Hands on a keyboard with a Python book " loading="lazy" class="image-style-article-teaser" /> </a> </div> Fri, 27 Jan 2023 08:00:00 +0000 hANSIc99 70417 at https://opensource.com How to fix an IndexError in Python https://opensource.com/article/23/1/fix-indexerror-python <span class="field field--name-title field--type-string field--label-hidden">How to fix an IndexError in Python</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/users/vijaytechnicalauthor" class="username">vijaytechnicalauthor</a></span> <span class="field field--name-created field--type-created field--label-hidden">Thu, 01/19/2023 - 03:00</span> <div class="clearfix text-formatted field field--name-field-article-subhead field--type-text-long field--label-hidden field__item"><p>Follow this Python tutorial to learn how to solve an IndexError.</p> </div> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>If you use Python, you may have encountered the IndexError error in response to some code you've written. The IndexError message in Python is a runtime error. To understand…</p> </div> <div class="field field--name-field-lead-image field--type-entity-reference field--label-hidden field__item"> <a href="/article/23/1/fix-indexerror-python" hreflang="en"><img src="/sites/default/files/styles/article_teaser/public/lead-images/coffee_python.jpg?itok=DDkfU_Or" width="360" height="202" alt="How to write a web service using Python Flask" title="How to write a web service using Python Flask" loading="lazy" class="image-style-article-teaser" /> </a> </div> Thu, 19 Jan 2023 08:00:00 +0000 vijaytechnicalauthor 70402 at https://opensource.com An introduction to DocArray, an open source AI library https://opensource.com/article/23/1/docarray-open-source-ai <span class="field field--name-title field--type-string field--label-hidden">An introduction to DocArray, an open source AI library</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/users/jinaai" class="username">Jina_AI</a></span> <span class="field field--name-created field--type-created field--label-hidden">Fri, 01/06/2023 - 03:00</span> <div class="clearfix text-formatted field field--name-field-article-subhead field--type-text-long field--label-hidden field__item"><p>DocArray is hosted by the Linux Foundation to provide an inclusive and standard multimodal data model within the open source community and beyond.</p> </div> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>DocArray is a library for nested, unstructured, multimodal data in transit, including text, image, audio, video, 3D mesh, and so on. It allows deep-learning engineers to…</p> </div> <div class="field field--name-field-lead-image field--type-entity-reference field--label-hidden field__item"> <a href="/article/23/1/docarray-open-source-ai" hreflang="en"><img src="/sites/default/files/styles/article_teaser/public/lead-images/brain_computer_solve_fix_tool.png?itok=CISnQ7pA" width="360" height="202" alt="Brain on a computer screen" title="Brain on a computer screen" loading="lazy" class="image-style-article-teaser" /> </a> </div> Fri, 06 Jan 2023 08:00:00 +0000 Jina_AI 70371 at https://opensource.com 10 resources for Python programmers https://opensource.com/article/22/12/best-python <span class="field field--name-title field--type-string field--label-hidden">10 resources for Python programmers</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/users/moshez" class="username">Moshe Zadka</a></span> <span class="field field--name-created field--type-created field--label-hidden">Mon, 12/26/2022 - 03:00</span> <div class="clearfix text-formatted field field--name-field-article-subhead field--type-text-long field--label-hidden field__item"><p>There&#039;s something for everyone in the world of Python this year.</p> </div> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>One of my favorite things about Python is that it's an actual language that's also useful as a teaching language. As in past years, Opensource.com had great articles…</p> </div> <div class="field field--name-field-lead-image field--type-entity-reference field--label-hidden field__item"> <a href="/article/22/12/best-python" hreflang="en"><img src="/sites/default/files/styles/article_teaser/public/2022-12/david-clode-vb-3qEe3rg8-unsplash.webp?itok=YaxbqXND" width="360" height="202" alt="A snake on a branch" loading="lazy" class="image-style-article-teaser" /> </a> </div> Mon, 26 Dec 2022 08:00:00 +0000 Moshe Zadka 70353 at https://opensource.com How I use Artipie, a PyPI repo https://opensource.com/article/22/12/python-package-index-repository-artipie <span class="field field--name-title field--type-string field--label-hidden">How I use Artipie, a PyPI repo</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/users/olena" class="username">olena</a></span> <span class="field field--name-created field--type-created field--label-hidden">Tue, 12/20/2022 - 03:00</span> <div class="clearfix text-formatted field field--name-field-article-subhead field--type-text-long field--label-hidden field__item"><p>Artipie is an open source self-hosted software repository manager that can be used for much more than just Python.</p> </div> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>While developing with Python as a student, I found that I needed some private centralized storage. This was so I could store binary and text data files, as well as Python…</p> </div> <div class="field field--name-field-lead-image field--type-entity-reference field--label-hidden field__item"> <a href="/article/22/12/python-package-index-repository-artipie" hreflang="en"><img src="/sites/default/files/styles/article_teaser/public/lead-images/programming-code-keyboard-laptop-music-headphones.png?itok=redapbg7" width="360" height="202" alt="Woman programming" title="Woman programming" loading="lazy" class="image-style-article-teaser" /> </a> </div> Tue, 20 Dec 2022 08:00:00 +0000 olena 70341 at https://opensource.com