Python Forum
Is there a datepicker which can be used in combination with the python library urwid?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is there a datepicker which can be used in combination with the python library urwid?
#1
Hello,
the module 'npyscreen' has two widgets to pick dates ('DateCombo' and 'TitleDateCombo').

I was told that the python library 'urwid' does not have a date picker, which is due to the complexity.
Unfortunately I could not find such a third-party library.

Although there are projects like 'khal', these are mostly designed as stand-alone applications and not as 'urwid' widgets.

Does anyone know such a project?
If there is no such thing, with which approaches can this lack be compensated?


'urwid.Edit' (basically a text field) has the problem that invalid data can be entered. Although a conversion to 'datetime.date' and exception handling does the trick, this is very clunky.

Here is the 'npyscreen' date picker and the associated source code:

[Image: hpkhL.png]

#! /usr/bin/env python3
# -*- coding: utf-8 -*-

import npyscreen

class DateForm(npyscreen.Form):
    def afterEditing(self):
        self.parentApp.setNextForm(None)

    def create(self):
        self.date = self.add(npyscreen.TitleDateCombo, name="Date")

class TestApplication(npyscreen.NPSAppManaged):
    def onStart(self):
        new_user = self.addForm("MAIN", DateForm, name="Read Date")

if __name__ == "__main__":
    TestApplication().run()
This question has also been posted on stackoverflow.

Best regards

AFoeee
Reply


Messages In This Thread
Is there a datepicker which can be used in combination with the python library urwid? - by AFoeee - Sep-21-2018, 08:20 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Group List Elements according to the Input with the order of binary combination quest_ 19 6,514 Jan-28-2021, 03:36 AM
Last Post: bowlofred
  Checking if the combination of two keys is in a dictionary? mrsenorchuck 6 3,916 Dec-04-2019, 10:35 AM
Last Post: mrsenorchuck
  how to get all the possible permutation and combination of a sentence in python sodmzs 1 4,181 Jun-13-2019, 07:02 AM
Last Post: perfringo
  while + if + elif + else combination ClassicalSoul 1 2,208 Mar-27-2019, 03:54 PM
Last Post: ichabod801
  A combination of Python and MySql xgrzeniu 2 3,999 Mar-28-2018, 06:50 AM
Last Post: xgrzeniu
  PyInstaller, how to create library folder instead of library.zip file ? harun2525 2 4,815 May-06-2017, 11:29 AM
Last Post: harun2525

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020