Site icon Python GUI

Learn To Build A Python GUI For Manipulating Date, Time, And Timestamps Using Arrow Library In A Delphi Windows App

blogbanner3 39

Are you looking for powerful tools to manipulate or format dates, times, and timestamps, and build a nice GUI for them? You can build it easily by combining Arrow and Python4Delphi library, inside Delphi and C++Builder.

Arrow is a Python library that offers a sensible and human-friendly approach to creating, manipulating, formatting, and converting dates, times, and timestamps. It implements and updates the datetime type, plugging gaps in functionality and providing an intelligent module API that supports many common creation scenarios. Simply put, it helps you work with dates and times with fewer imports and a lot less code.

Arrow is named after the arrow of time and is heavily inspired by moment.js and requests.

1. Why use Arrow over built-in modules?

Python’s standard library and some other low-level modules have a near-complete date, time, and timezone functionality, but don’t work very well from a usability perspective:

 

2. Features

 

3. Hands-On

This post will guide you on how to run various manipulations to dates, times, and timestamps using Python’s Arrow library and then display it in the Delphi Windows GUI app using Python for Delphi.

First, open and run our Python GUI using project Demo1 from Python4Delphi with RAD Studio. Then insert the script into the lower Memo, click the Execute button, and get the result in the upper Memo. You can find the Demo1 source on GitHub. The behind the scene details of how Delphi manages to run your Python code in this amazing Python GUI can be found at this link.

And then, let’s run these code to print out some operations in our Python GUI:

[crayon-6621bd8b139df059190249/]

 

Congratulations, now you have learned how to run various manipulations to dates, times, and timestamps using Python’s Arrow library and then display it in the Delphi Windows GUI app using Python for Delphi!

Check out the Arrow library for Python and use it in your projects: https://pypi.org/project/arrow/ and

Check out Python4Delphi which easily allows you to build Python GUIs for Windows using Delphi: https://github.com/pyscripter/python4delphi

Exit mobile version