Language Selection

English French German Italian Portuguese Spanish

Programming With Python

Filed under
Development
  • For loop in Django template

    For loop is used to iterate over any iterable object, accessing one item at a time and making it available inside the for loop body.

  • Creating custom template tags in Django

    Sometimes existing templates tags are not enough for rebellious developers. They need to create custom template tags to use.

  • Python Anywhere: Using our file API

    Our API supports lots of common PythonAnywhere operations, like creating and managing consoles, scheduled and always-on tasks, and websites. We recently added support for reading/writing files; this blog post gives a brief overview of how you can use it to do that.

  • Make an RGB cube with Python and Scribus

    When I decided I wanted to play with color this summer, I thought about the fact that colors are usually depicted on a color wheel. This is usually with pigment colors rather than light, and you lose any sense of the variation in color brightness or luminosity.

    As an alternative to the color wheel, I came up with the idea of displaying the RGB spectrum on the surfaces of a cube using a series of graphs. RGB values would be depicted on a three-dimensional graph with X-, Y-, and Z-axes. For example, a surface would keep B (or blue) at 0 and the remaining axes would show what happens as I plot values as colors for R (red) and G (green) from 0 to 255.

    It turns out this is not very difficult to do using Scribus and its Python Scripter capability. I can create RGB colors, make rectangles showing the colors, and arrange them in a 2D format. I decided to make value jumps of 5 for the colors and make rectangles measuring 5 points on a side. Thus, for each 2D graph, I would make about 250 colors, and the cube would measure 250 points to a side, or 3.5 inches.

  • Wing Python IDE 7.0.4

    Wing 7 introduces an improved code warnings and code quality inspection system that includes built-in error detection and tight integration with Pylint, pep8, and mypy. This release also adds a new data frame and array viewer, a MATLAB keyboard personality, easy inline debug data display with Shift-Space, improved stack data display, support for PEP 3134 chained exceptions, callouts for search and other code navigation features, four new color palettes, improved bookmarking, a high-level configuration menu, magnified presentation mode, a new update manager, stepping over import internals, simplified remote agent installation, and much more.

  • Data School: My top 25 pandas tricks (video)

    In my new pandas video, you're going to learn 25 tricks that will help you to work faster, write better code, and impress your friends. These are the most useful tricks I've learned from 5 years of teaching Python's pandas library.

    Each trick is about a minute long, so you're going to learn a ton of new pandas skills in less than 30 minutes!

  • ODSC webinar: End-to-End Data Science Without Leaving the GPU

    In this webinar sponsored by the Open Data Science Conference (ODSC), I outline a brief history of GPU analytics and the problems that using GPU analytics solves relative to using other parallel computation methods such as Hadoop. I also demonstrate how OmniSci fits into the broader GPU-accelerated data science workflow, with examples provided using Python.

  • Convert hexadecimal number to decimal number with Python program
  • Introduction to unit testing with Python
  • Python 3.7.3 : Three examples with BeautifulSoup.
  • SongSearch autocomplete rate now 2+ per second
  • 2019 PSF Fundraiser - Thank you & debrief
  • PSF GSoC students blogs: Week #6
  • PSF GSoC students blogs: Fourth Blog - GSOC 2019
  • PSF GSoC students blogs: Coding and Communication

More in Tux Machines

GNU Parallel Released and 10 Years of GNU Health

  • GNU Parallel 20191022 ('Driving IT') released [stable]

    GNU Parallel 20191022 ('Driving IT') [stable] has been released. It is available for download at: http://ftpmirror.gnu.org/parallel/ No new functionality was introduced so this is a good candidate for a stable release. GNU Parallel is 10 years old next year on 2020-04-22. You are here by invited to a reception on Friday 2020-04-17.

  • GNU Health: 10 years of Freedom and Equity in Healthcare

    I am back from my trip to India, where I spent a week with the team of All India Institute of Medical Sciences – AIIMS –, the largest public hospital in Asia and a leading research institution. They have taken the decision to adopt GNU Health, the Free Hospital and Health Information System. One key aspect in Free Software is ownership. From the moment they adopted GNU Health, it now also belongs to AIIMS. They have full control over it. They can download and upgrade the system; access the source code; customize it to fit their needs; and contribute back to the community. This is the definition of Free Software. The definition of Free Software is universal. GNU Health is equally valid for very large institutions, national public health networks and small, rural or primary care centers. The essence is the same.

Programming Leftovers

  • NumFOCUS and Tidelift partner to support essential community-led open source data science and scientific computing projects

    NumFOCUS and Tidelift today announced a partnership to support open source libraries critical to the Python data science and scientific computing ecosystem. NumPy, SciPy, and pandas—sponsored projects within NumFOCUS—are now part of the Tidelift Subscription. Working in collaboration with NumFOCUS, Tidelift financially supports the work of project maintainers to provide ongoing security updates, maintenance and code improvements, licensing verification and indemnification, and more to enterprise engineering and data science teams via a managed open source subscription from Tidelift.

  • Python Plotting With Matplotlib

    A picture is worth a thousand words, and with Python’s matplotlib library, it fortunately takes far less than a thousand words of code to create a production-quality graphic. However, matplotlib is also a massive library, and getting a plot to look just right is often achieved through trial and error. Using one-liners to generate basic plots in matplotlib is relatively simple, but skillfully commanding the remaining 98% of the library can be daunting.

  • Nominations for 2019 Malcolm Tredinnick Memorial Prize

    Malcolm was an early core contributor to Django and had both a huge influence and large impact on Django as we know it today. Besides being knowledgeable he was also especially friendly to new users and contributors. He exemplified what it means to be an amazing Open Source contributor. We still miss him. The DSF Prize page summarizes the prize nicely: The Malcolm Tredinnick Memorial Prize is a monetary prize, awarded annually, to the person who best exemplifies the spirit of Malcolm’s work - someone who welcomes, supports and nurtures newcomers; freely gives feedback and assistance to others, and helps to grow the community. The hope is that the recipient of the award will use the award stipend as a contribution to travel to a community event -- a DjangoCon, a PyCon, a sprint -- and continue in Malcolm’s footsteps.

  • Dirk Eddelbuettel: pkgKitten 0.1.5: Creating R Packages that purr

    This release provides a few small changes. The default per-package manual page now benefits from a second refinement (building on what was introduced in the 0.1.4 release) in using the Rd macros referring to the DESCRIPTION file rather than duplicating information. Several pull requests fixes sloppy typing in the README.md, NEWS.Rd or manual page—thanks to all contributors for fixing these. Details below.

Commitment To Elevating The Very Best

OSI applauds the efforts of every individual who has ever spoken up and taken steps to make free, libre, and open source software communities more inclusive. Without you, the movement would be less vibrant, less welcoming, and irreversibly diminished. Whether you’ve led your community to implement a code of conduct or taken the time to mentor someone who isn’t like you, whether you’ve reported toxic behavior or pressured community leaders to act: thank you. It takes courage to change the status quo, and all too often, that comes at a personal expense. Ultimately, ours is a moral movement, and our integrity hinges on whether we rise to meet the challenge of seeking justice and equity for all. As we move forward, we hope that we can learn as a community and incorporate the lessons of the past into building a better future. Further, we hope we can build bridges to those who have been shut out of our movement, whether by omission or commission, at the hands of systemic bias as well as toxic and predatory behavior. As the saying goes in open source, “Many eyes lead to shallower bugs.” So too do many perspectives lead to better software. Here’s to a better, more inclusive tomorrow. - The OSI Board of Directors Read more

NextCloud on Pi Adventures and Escaping Google

  • NextCloud on Pi Adventures

    I spent yesterday *finally* setting up a NextCloud instance of my own. It’s been on my todo since I installed fiber at home and got a decent Internet connection. I started out with Rasbian Lite and combined it with the NextCloudPi install script from ownyourbits. I then used certbot to install certificates from let’s encrypt before migrating the data directory using these instructions. After that it was happy account creation time, before realizing that I could not upload files larger than ~10kB. Very annoying.

  • Escape Google!

    Being practical most people are going to want to keep using Google services, but at least knowing what the issues are, how you can use privacy-enhanced versions or escape completely with your own services is good to know. While Nextcloud is so slick these days and with pre-packaged options it’s certainly fun just to try out, if not deployed as a full-time personal cloud solution. But it’s not all worrying about invasion of the privacy snatchers, we’ve plenty of down-to-earth tutorials and projects to keep you busy. We take another look at using Audacity to improve your YouTube audio and create effects, we test out of a bunch of server distros to see which is best for you in Roundup, there’s some lovely retro loving with a look at running ZX Basic and we look at building a wearable webcam from a Pi Zero. Enjoy!