Language Selection

English French German Italian Portuguese Spanish

Python Programming

Filed under
Development
  • Invoking Zato Python microservices with OpenAPI

    One of the exciting additions of the upcoming Zato 3.2 release is the ability to invoke services through OpenAPI endpoints without a need for creation of REST channels explicitly - read more for details.

    Python code

    Supposing we have a service such as below - note that it is uses SimpleIO and that each of its input/output attributes is documented in the docstring - we would like to invoke it from an external application while delegating to Zato as much effort involved in it as possible.

  • … and benchmarks

    And he also tries Cython on this benchmark. However, for whatever reason, he tries it on the second version, where the Python runtime is doing all the work, not on the first one, which is the one that is computationally heavy in user code. Unsurprisingly, compiling the second version gives almost no speed-up compared to exercising the exact same implementation of the built-in range(), str(), map() and list() functions in the interpreter.

  • A beginner's guide to web scraping with Python

    Many people find instructional books useful, but I do not typically learn by reading a book front to back. I learn by doing a project, struggling, figuring some things out, and then reading another book. So, throw away your book (for now), and let's learn some Python.

    What follows is a guide to my first scraping project in Python. It is very low on assumed knowledge in Python and HTML. This is intended to illustrate how to access web page content with Python library requests and parse the content using BeatifulSoup4, as well as JSON and pandas. I will briefly introduce Selenium, but I will not delve deeply into how to use that library—that topic deserves its own tutorial. Ultimately I hope to show you some tricks and tips to make web scraping less overwhelming.

  • Waiting in asyncio

    One of the main appeals of using asyncio is being able to fire off many coroutines and run them concurrently. How many ways do you know for waiting for their results?

    There’s quite a bit of them! However the different ways have different properties and all of them deserve their place. However I regularly have to look them up to find the right one.

More in Tux Machines

Mozilla: Accessibility, Net Neutrality, AMP and Rust

  • Mozilla Accessibility: Broadening Our Impact

    Last year, the accessibility team worked to identify and fix gaps in our screen reader support, as well as on some new areas of focus, like improving Firefox for users with low vision. As a result, we shipped some great features. In addition, we’ve begun building awareness across Mozilla and putting in place processes to help ensure delightful accessibility going forward, including a Firefox wide triage process. With a solid foundation for delightful accessibility well underway, we’re looking at the next step in broadening our impact: expanding our engagement with our passionate, global community. It’s our hope that we can get to a place where a broad community of interested people become active participants in the planning, design, development and testing of Firefox accessibility. To get there, the first step is open communication about what we’re doing and where we’re headed.

  • Mozilla Open Policy & Advocacy Blog: Next Steps for Net Neutrality

    Two years ago we first brought Mozilla v. FCC in federal court, in an effort to save the net neutrality rules protecting American consumers. Mozilla has long fought for net neutrality because we believe that the internet works best when people control their own online experiences. Today is the deadline to petition the Supreme Court for review of the D.C. Circuit decision in Mozilla v. FCC. After careful consideration, Mozilla—as well as its partners in this litigation—are not seeking Supreme Court review of the D.C. Circuit decision. Even though we did not achieve all that we hoped for in the lower court, the court recognized the flaws of the FCC’s action and sent parts of it back to the agency for reconsideration. And the court cleared a path for net neutrality to move forward at the state level. We believe the fight is best pursued there, as well as on other fronts including Congress or a future FCC. Net neutrality is more than a legal construct. It is a reflection of the fundamental belief that ISPs have tremendous power over our online experiences and that power should not be further concentrated in actors that have often demonstrated a disregard for consumers and their digital rights. The global pandemic has moved even more of our daily lives—our work, school, conversations with friends and family—online. Internet videos and social media debates are fueling an essential conversation about systemic racism in America. At this moment, net neutrality protections ensuring equal treatment of online traffic are critical. Recent moves by ISPs to favor their own content channels or impose data caps and usage-based pricing make concerns about the need for protections all the more real.

  • Frédéric Wang: Contributions to Web Platform Interoperability (First Half of 2020)

    Web developers continue to face challenges with web interoperability issues and a lack of implementation of important features. As an open-source project, the AMP Project can help represent developers and aid in addressing these challenges. In the last few years, we have partnered with Igalia to collaborate on helping advance predictability and interoperability among browsers. Standards and the degree of interoperability that we want can be a long process. New features frequently require experimentation to get things rolling, course corrections along the way and then, ultimately as more implementations and users begin exploring the space, doing really interesting things and finding issues at the edges we continue to advance interoperability. Both AMP and Igalia are very pleased to have been able to play important roles at all stages of this process and help drive things forward. During the first half of this year, here’s what we’ve been up to…

  • Community crossover, Rust at CNCF, and more industry trends

    The impact: The Rust community has a reputation of welcoming loveliness; increased overlap in the Rust and CNCF Venn diagrams is a harbinger of good things for both communities.

Videos: Software Freedom, OpenSUSE 15.2, "Rolling Rhino" and Linux Headlines

Games: Oxygen Not Included, Proton, GDScript

  • The first DLC for Oxygen Not Included sounds huge, free update soon too

    Klei Entertainment have been busy working behind the scenes on the next free update and first expansion for Oxygen Not Included and they've detailed what's coming. First, the free update coming within the next few days should fix plenty of issues, including one involving infinite digging which sounds annoying. More exciting is the DLC though, it's sounding like it's going to be massive!

  • VKD3D-Proton is the new official Direct3D 12 to Vulkan layer for Proton

    VKD3D was originally a project created directly by the Wine team, the compatibility layer that Proton is built upon. However, the original founder passed away and it seems Valve-funded developers are taking the torch to push it much further. It's actually been a thing for a while but today they adjusted the name of their project as VKD3D-Proton, to give it some official status plus preventing any naming conflicts elsewhere and just be clear about their goals. They're going for supporting the "full" Direct3D 12 API on top of Vulkan, with an aim of both performance and compatibility using modern Vulkan extensions and features, so this comes at the expense of compatibility with older drivers and GPUs. They're also not looking to keep backwards compatibility with the original vkd3d.

  • GDScript progress report: Type checking is back

    After completing the new tokenizer and parser as mentioned in the previous reports, I started working on the code analyzer, which is responsible for type checking and also for used for other features like warnings and some optimizations. This was done before as a second pass inside the parser but it was now moved to another class to make it clear that it doesn't happen at the same pass thus avoiding issues with functions being called out of order (which happened by a few contributions that missed this detail).

today's howtos